Skip to content

Commit

Permalink
simpler block format for nested group generated when invoking a share…
Browse files Browse the repository at this point in the history
…d group
  • Loading branch information
dchelimsky committed Aug 1, 2010
1 parent f39187d commit cc72146
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rspec/core/example_group.rb
Expand Up @@ -64,9 +64,10 @@ def self.#{new_name}(name, &customization_block)
shared_block = world.shared_example_groups[name]
raise "Could not find shared example group named \#{name.inspect}" unless shared_block
shared_group = describe("#{report_label || "it should behave like"} \#{name}", &shared_block)
shared_group.class_eval(&customization_block) if customization_block
shared_group
describe("#{report_label || "it should behave like"} \#{name}") do
module_eval &shared_block
module_eval &customization_block if customization_block
end
end
END_RUBY
end
Expand Down

0 comments on commit cc72146

Please sign in to comment.