Permalink
Browse files

spec refactoring: replace subject with intention revealing name

  • Loading branch information...
1 parent 1004353 commit e343cbaf0f49bedeb484749e76ce41a18cfca4e0 @dchelimsky dchelimsky committed May 12, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 spec/rspec/core/example_group_spec.rb
@@ -359,15 +359,14 @@ def metadata_hash(*args)
[:focus, :focused].each do |example_alias|
describe "##{example_alias}" do
- let(:group) { ExampleGroup.describe }
- subject { group.send example_alias, "a focused example" }
+ let(:focused_example) { ExampleGroup.describe.send example_alias, "a focused example" }
it 'defines an example that can be filtered with :focused => true' do
- subject.metadata.should include(:focused => true)
+ focused_example.metadata[:focused].should be_true
end
it 'defines an example that can be filtered with :focus => true' do
- subject.metadata.should include(:focus => true)
+ focused_example.metadata[:focus].should be_true
end
end
end

0 comments on commit e343cba

Please sign in to comment.