Sha256: 97f0f825454f3cdf06205dcf80dce8687e30504778dabbebd9288977e7b1f4c3

Contents?: true

Size: 838 Bytes

Versions: 6

Compression:

Stored size: 838 Bytes

Contents

require 'spec_helper'

require 'spec_helper'

describe Gurke::StepDefinition do
  let(:pattern)  { nil }
  let(:step_definition) { described_class.new pattern }
  subject { step_definition }

  context '#match' do
    context 'with regex' do
      let(:pattern) { /dies ist (ein|zwei) regex/ }

      it { expect(subject.match('dies ist ein regex')).to be_a(Gurke::StepDefinition::Match) }
      it { expect(subject.match('dies ist zwei regex')).to be_a(Gurke::StepDefinition::Match) }
    end

    context 'with string' do
      let(:pattern) { 'a string' }

      it { expect(subject.match('a string')).to be_a(Gurke::StepDefinition::Match) }
      it { expect(subject.match(' a string')).to be_nil }
      it { expect(subject.match('a string ')).to be_nil }
      it { expect(subject.match(' a string ')).to be_nil }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gurke-2.4.2 spec/gurke/step_definition_spec.rb
gurke-2.4.1 spec/gurke/step_definition_spec.rb
gurke-2.4.0 spec/gurke/step_definition_spec.rb
gurke-2.3.0 spec/gurke/step_definition_spec.rb
gurke-2.2.2 spec/gurke/step_definition_spec.rb
gurke-2.2.1 spec/gurke/step_definition_spec.rb