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

Commit be9bdf9

Browse files
committed
Spec for #to_s human readable print
1 parent a3aa316 commit be9bdf9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/rspec/core/example_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def metadata_hash(*args)
2222
expect { ignoring_warnings { pp example_instance }}.to output(/RSpec::Core::Example/).to_stdout
2323
end
2424

25-
it 'prints a human readable description when inspected' do
26-
ex = nil
27-
28-
RSpec.describe do
29-
ex = example("An example's description") {}
25+
describe "human readable output" do
26+
it 'prints a human readable description when inspected' do
27+
expect(example_instance.inspect).to eq("#<RSpec::Core::Example \"example description\">")
3028
end
3129

32-
expect(ex.inspect).to eq("#<RSpec::Core::Example \"An example's description\">")
30+
it 'prints a human readable description for #to_s' do
31+
expect(example_instance.to_s).to eq("#<RSpec::Core::Example \"example description\">")
32+
end
3333
end
3434

3535
describe "#rerun_argument" do

0 commit comments

Comments
 (0)