Sha256: d79607c3aab3edf17b85587ce01748ce6e6bd4220c64024178eb73f2f6d8e29f

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

require 'cucumber/pickles/fill_in'
require 'cucumber/pickles/check_in'

RSpec.describe '#CheckIn::Factory' do

  class NewCoolStep
    def initialize(*); end
  end

  Pickles.configure do |config|
    config.check_tag_steps_map = {
      'new_cool_step' => NewCoolStep
    }
  end

  it 'uses custom step if label demands it' do
    label = "input (new_cool_step)"

    step = CheckIn::Factory.new(label, nil).call

    expect(step).to be_instance_of(NewCoolStep)
  end

  it 'uses input step if custom step required but not defined' do
    label = "input (another_cool_step)"

    step = CheckIn::Factory.new(label, nil).call

    expect(step).to be_instance_of(CheckIn::Input)
  end

  it 'uses complex input step if value has :' do
    label = "input (new_cool_step)"
    value = "1:2:3"

    step = CheckIn::Factory.new(label, value).call

    expect(step).to be_instance_of(CheckIn::ComplexInput)
  end

  it 'uses input step by default' do
    label = "input"
    value = "1"

    step = CheckIn::Factory.new(label, value).call

    expect(step).to be_instance_of(CheckIn::Input)
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pickles-0.2.4 spec/steps/check_in/factory_spec.rb
pickles-0.2.3 spec/steps/check_in/factory_spec.rb
pickles-0.2.2 spec/steps/check_in/factory_spec.rb
pickles-0.2.1 spec/steps/check_in/factory_spec.rb
pickles-0.2.0 spec/steps/check_in/factory_spec.rb
pickles-0.1.12 spec/steps/check_in/factory_spec.rb
pickles-0.1.10 spec/steps/check_in/factory_spec.rb
pickles-0.1.9 spec/steps/check_in/factory_spec.rb
pickles-0.1.8 spec/steps/check_in/factory_spec.rb
pickles-0.1.7 spec/steps/check_in/factory_spec.rb
pickles-0.1.6 spec/steps/check_in/factory_spec.rb
pickles-0.1.5 spec/steps/check_in/factory_spec.rb
pickles-0.1.4 spec/steps/check_in/factory_spec.rb
pickles-0.1.3 spec/steps/check_in/factory_spec.rb
pickles-0.1.2 spec/steps/check_in/factory_spec.rb
pickles-0.1.1 spec/steps/check_in/factory_spec.rb
pickles-0.1.0 spec/steps/check_in/factory_spec.rb