Sha256: 7907310f42c256069778338e9705936b7ba0d89ee160996b9c0009f630551bcb

Contents?: true

Size: 642 Bytes

Versions: 32

Compression:

Stored size: 642 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

32 entries across 30 versions & 8 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
casecumber-1.2.1.cb2 spec/cucumber/rb_support/rb_transform_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.2.1 spec/cucumber/rb_support/rb_transform_spec.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.2.0 spec/cucumber/rb_support/rb_transform_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/rb_transform_spec.rb
cucumber-1.1.9 spec/cucumber/rb_support/rb_transform_spec.rb