Sha256: a58f8aa9dd0c9fa295e2bfe273e4fcb39da02ff6a3a1331e0f78e03590040554

Contents?: true

Size: 627 Bytes

Versions: 27

Compression:

Stored size: 627 Bytes

Contents

require 'spec_helper'
require 'cucumber/rb_support/rb_transform'

module Cucumber
  module RbSupport
    describe RbTransform do
      def transform(regexp)
        RbTransform.new(nil, regexp, lambda { |a| })
      end
      describe "#to_s" do
        it "converts captures groups to non-capture groups" do
          transform(/(a|b)bc/).to_s.should == "(?:a|b)bc"
        end

        it "leaves non capture groups alone" do
          transform(/(?:a|b)bc/).to_s.should == "(?:a|b)bc"
        end

        it "strips away anchors" do
          transform(/^xyz$/).to_s.should == "xyz"
        end
      end
    end
  end
end

Version data entries

27 entries across 25 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/spec/cucumber/rb_support/rb_transform_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/spec/cucumber/rb_support/rb_transform_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.20 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.19 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.18 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.17 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.16 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.15 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.14 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.13 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.12 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.11 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.10 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.9 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.8 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.7 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.6 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.5 spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.3.4 spec/cucumber/rb_support/rb_transform_spec.rb