Flowdock
method

store_and_call

Importance_0
1.1.4 - Show latest stable - 0 notes - Class: Spec::Story::World
store_and_call(world, type, name, *args, &block) public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/story/world.rb, line 57
        def store_and_call(world, type, name, *args, &block)
          if block_given?
            step_mother.store(type, Step.new(name, &block))
          end
          step = step_mother.find(type, name)

          step_name = step.name
          step_names << step_name
          
          # It's important to have access to the parsed args here, so
          # we can give them to the listeners. The HTML reporter needs
          # 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
            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) }
            else
              @listeners.each { |l| l.step_failed(type, step_name, *args) }
            end
            errors << e
          end
        end
Register or log in to add new notes.