vendor/plugins/rspec/lib/spec/story/world.rb in spree-0.2.0 vs vendor/plugins/rspec/lib/spec/story/world.rb in spree-0.4.0
- old
+ new
@@ -1,6 +1,5 @@
-require 'rubygems'
require 'spec/expectations'
require 'spec/matchers'
require 'spec/example/pending'
module Spec
@@ -47,11 +46,11 @@
def run_given_scenario_with_suspended_listeners(world, type, name, scenario)
current_listeners = Array.new(listeners)
begin
listeners.each { |l| l.found_scenario(type, name) }
@listeners.clear
- scenario.perform(world, name) unless ::Spec::Story::Runner.dry_run
+ scenario.perform(world, name) unless dry_run
ensure
@listeners.replace(current_listeners)
end
end
@@ -69,11 +68,11 @@
# the args so it can style them. See the generated output in
# story_server/prototype/rspec_stories.html (generated by rake stories)
args = step.parse_args(name) if args.empty?
begin
listeners.each { |l| l.step_upcoming(type, step_name, *args) }
- step.perform(world, *args) unless ::Spec::Story::Runner.dry_run
+ step.perform(world, *args) unless dry_run
listeners.each { |l| l.step_succeeded(type, step_name, *args) }
rescue Exception => e
case e
when Spec::Example::ExamplePendingError
@listeners.each { |l| l.step_pending(type, step_name, *args) }
@@ -84,9 +83,13 @@
end
end
def errors
@errors ||= []
+ end
+
+ def dry_run
+ ::Spec::Story::Runner.dry_run
end
end # end of class << self
def start_collecting_errors
errors.clear