Sha256: 600c9125d61f097a3b876d7f35d65d2056f67913cb9da81b8508875fe45cd147

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 Bytes

Contents

require_relative '../spec_helper'

module Lucid
  module InterfaceRb
    describe RbTransform do

      def transform(regexp)
        RbTransform.new(nil, regexp, lambda { |a| })
      end
      
      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 line anchors' do
        transform(/^xyz$/).to_s.should == 'xyz'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lucid-0.4.1 spec/lucid/rb_transform_spec.rb
lucid-0.4.0 spec/lucid/rb_transform_spec.rb
lucid-0.3.3 spec/lucid/rb_transform_spec.rb
lucid-0.3.0 spec/lucid/rb_transform_spec.rb