Skip to content

Commit

Permalink
align usage of expect/to
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Apr 17, 2012
1 parent 5908107 commit 3591cd2
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions spec/rspec/matchers/start_with_end_with_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
end

it "fails if it does not match the start of the actual string" do
lambda {
expect {
"this string".should start_with "that str"
}.should fail_with("expected \"this string\" to start with \"that str\"")
}.to fail_with("expected \"this string\" to start with \"that str\"")
end
end

Expand All @@ -23,15 +23,15 @@
end

it "fails if it does not match the first element of the array" do
lambda {
expect {
[0, 1, 2].should start_with 2
}.should fail_with("expected [0, 1, 2] to start with 2")
}.to fail_with("expected [0, 1, 2] to start with 2")
end

it "fails if it the first elements of the array do not match" do
lambda {
expect {
[0, 1, 2].should start_with 1, 2
}.should fail_with("expected [0, 1, 2] to start with [1, 2]")
}.to fail_with("expected [0, 1, 2] to start with [1, 2]")
end
end

Expand All @@ -57,9 +57,9 @@
end

it "fails if it does match the start of the actual string" do
lambda {
expect {
"this string".should_not start_with "this str"
}.should fail_with("expected \"this string\" not to start with \"this str\"")
}.to fail_with("expected \"this string\" not to start with \"this str\"")
end
end

Expand All @@ -73,15 +73,15 @@
end

it "fails if it matches the first element of the array" do
lambda {
expect {
[0, 1, 2].should_not start_with 0
}.should fail_with("expected [0, 1, 2] not to start with 0")
}.to fail_with("expected [0, 1, 2] not to start with 0")
end

it "fails if it the first elements of the array match" do
lambda {
expect {
[0, 1, 2].should_not start_with 0, 1
}.should fail_with("expected [0, 1, 2] not to start with [0, 1]")
}.to fail_with("expected [0, 1, 2] not to start with [0, 1]")
end
end
end
Expand All @@ -93,9 +93,9 @@
end

it "fails if it does not match the end of the actual string" do
lambda {
expect {
"this string".should end_with "is stringy"
}.should fail_with("expected \"this string\" to end with \"is stringy\"")
}.to fail_with("expected \"this string\" to end with \"is stringy\"")
end
end

Expand All @@ -109,15 +109,15 @@
end

it "fails if it does not match the last element of the array" do
lambda {
expect {
[0, 1, 2].should end_with 1
}.should fail_with("expected [0, 1, 2] to end with 1")
}.to fail_with("expected [0, 1, 2] to end with 1")
end

it "fails if it the last elements of the array do not match" do
lambda {
expect {
[0, 1, 2].should end_with [0, 1]
}.should fail_with("expected [0, 1, 2] to end with [0, 1]")
}.to fail_with("expected [0, 1, 2] to end with [0, 1]")
end
end

Expand All @@ -144,9 +144,9 @@
end

it "fails if it matches the end of the actual string" do
lambda {
expect {
"this string".should_not end_with "string"
}.should fail_with("expected \"this string\" not to end with \"string\"")
}.to fail_with("expected \"this string\" not to end with \"string\"")
end
end

Expand All @@ -160,15 +160,15 @@
end

it "fails if it matches the last element of the array" do
lambda {
expect {
[0, 1, 2].should_not end_with 2
}.should fail_with("expected [0, 1, 2] not to end with 2")
}.to fail_with("expected [0, 1, 2] not to end with 2")
end

it "fails if it the last elements of the array match" do
lambda {
expect {
[0, 1, 2].should_not end_with [1, 2]
}.should fail_with("expected [0, 1, 2] not to end with [1, 2]")
}.to fail_with("expected [0, 1, 2] not to end with [1, 2]")
end
end
end

0 comments on commit 3591cd2

Please sign in to comment.