Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Replace "should" with "is expected to" in Generated Descriptions #2572

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions features/command_line/line_number_appended_to_path.feature
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,5 @@ Feature: line number appended to file path
Scenario: Matching one-liners
When I run `rspec one_liner_spec.rb:3 --format doc`
Then the examples should all pass
Then the output should contain "should be > 8"
But the output should not contain "should be < 10"
Then the output should contain "is expected to be > 8"
But the output should not contain "is expected to be < 10"
8 changes: 4 additions & 4 deletions features/subject/one_liner_syntax.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Feature: One-liner syntax
"""
Array
when first created
should be empty
should be empty
is expected to be empty
is expected to be empty
"""

Scenario: Explicit subject
Expand All @@ -68,6 +68,6 @@ Feature: One-liner syntax
"""
Array
with 3 items
should not be empty
should not be empty
is expected not to be empty
is expected not to be empty
"""
12 changes: 6 additions & 6 deletions spec/rspec/core/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ def assert(val)
it "uses the matcher-generated description" do
example_group.example { expect(5).to eq(5) }
example_group.run
expect(example_group.examples.first.description).to eq("should eq 5")
expect(example_group.examples.first.description).to eq("is expected to eq 5")
end

it "uses the matcher-generated description in the full description" do
example_group.example { expect(5).to eq(5) }
example_group.run
expect(example_group.examples.first.full_description).to eq("group description should eq 5")
expect(example_group.examples.first.full_description).to eq("group description is expected to eq 5")
end

it "uses the file and line number if there is no matcher-generated description" do
Expand All @@ -213,7 +213,7 @@ def assert(val)
it "still uses the matcher-generated description if a matcher ran" do
example = example_group.example { pending; expect(4).to eq(5) }
example_group.run
expect(example.description).to eq("should eq 5")
expect(example.description).to eq("is expected to eq 5")
end

it "uses the file and line number of the example if no matcher ran" do
Expand All @@ -232,7 +232,7 @@ def assert(val)
after { raise "boom" }
end.run

expect(ex.description).to eq("should eq 2")
expect(ex.description).to eq("is expected to eq 2")
end
end

Expand Down Expand Up @@ -268,7 +268,7 @@ def assert(val)
after { expect(true).to eq(true) }
end.run

expect(ex).to pass.and have_attributes(:description => "should be nil")
expect(ex).to pass.and have_attributes(:description => "is expected to be nil")
end
end
end
Expand All @@ -279,7 +279,7 @@ def assert(val)
it "uses the matcher-generated description" do
example_group.example { expect(5).to eq(5) }
example_group.run
expect(example_group.examples.first.description).to eq("should eq 5")
expect(example_group.examples.first.description).to eq("is expected to eq 5")
end

it "uses the file and line number if there is no matcher-generated description" do
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/core/pending_example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
end
end.run

expect(ex.description).to eq('should eq "gnirts"')
expect(ex.description).to eq('is expected to eq "gnirts"')
end
end

Expand Down