Permalink
Browse files

small refactoring

  • Loading branch information...
1 parent 0367904 commit 05c5f517c8df5a7e1c65272430f3949274b75697 @dchelimsky dchelimsky committed Oct 9, 2010
Showing with 2 additions and 25 deletions.
  1. +2 −24 lib/rspec/core/command_line.rb
  2. +0 −1 lib/rspec/core/example_group.rb
View
26 lib/rspec/core/command_line.rb
@@ -20,36 +20,14 @@ def run(err, out)
@world.announce_inclusion_filter
@world.announce_exclusion_filter
- @configuration.reporter.report(example_count) do |reporter|
+ @configuration.reporter.report(@world.example_count) do |reporter|
begin
@configuration.run_hook(:before, :suite)
- example_groups.run_examples(reporter)
+ @world.example_groups.map {|g| g.run(reporter)}.all?
ensure
@configuration.run_hook(:after, :suite)
end
end
-
- example_groups.success?
- end
-
- private
-
- def example_count
- @world.example_count
- end
-
- module ExampleGroups
- def run_examples(reporter)
- @success = self.inject(true) {|success, group| success &= group.run(reporter)}
- end
-
- def success?
- @success ||= false
- end
- end
-
- def example_groups
- @world.example_groups.extend(ExampleGroups)
end
end
end
View
1 lib/rspec/core/example_group.rb
@@ -209,7 +209,6 @@ def self.run(reporter)
RSpec.clear_remaining_example_groups if top_level?
return
end
- @reporter = reporter
example_group_instance = new
reporter.example_group_started(self)

0 comments on commit 05c5f51

Please sign in to comment.