Sha256: 0a9a8c310d1accb5bbbccca7ccd6eaa6c22ae3d9782aea7739560111f01ba924

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

module RSpec::Steps
  class Step < Struct.new(:metadata, :args, :action)
    def initialize(*whatever)
      super
      @failed_step = nil
    end
    attr_accessor :failed_step

    def define_on(step_list, example_group)
      step = self
      example_group.it(*args, metadata) do |example|
        step_list.run_only_once(self, example)
        result = step_list.result_for(step)
        pending if result.is_after_failed_step?
        expect(result).to have_executed_successfully
      end
    end

    def run_inside(example, ex_obj)
      example.instance_exec(ex_obj, &action)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-steps-2.1.1 lib/rspec-steps/step.rb