Sha256: d260828e8712f8b1fd5c1bb3ba03985c3b2f37b71a911c01cdd6dffc4424d810

Contents?: true

Size: 868 Bytes

Versions: 9

Compression:

Stored size: 868 Bytes

Contents

# frozen_string_literal: true

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

9 entries across 9 versions & 1 rubygems

Version Path
gurke-3.3.4 spec/gurke/step_definition_spec.rb
gurke-3.3.3 spec/gurke/step_definition_spec.rb
gurke-3.3.2 spec/gurke/step_definition_spec.rb
gurke-3.3.1 spec/gurke/step_definition_spec.rb
gurke-3.2.2 spec/gurke/step_definition_spec.rb
gurke-3.2.1 spec/gurke/step_definition_spec.rb
gurke-3.2.0 spec/gurke/step_definition_spec.rb
gurke-3.1.0 spec/gurke/step_definition_spec.rb
gurke-3.0.0 spec/gurke/step_definition_spec.rb