Sha256: 74cf290f1654e62c49b321798556980e10644db29b40089e361e6a99475ddcc3

Contents?: true

Size: 702 Bytes

Versions: 17

Compression:

Stored size: 702 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "/../../helper"))

module Johnson
  module Conversions
    class RegexpTest < Johnson::TestCase
      def test_regex_converts
        @runtime[:x] = /aaron/
        @runtime[:y] = /john/i
        assert @runtime.evaluate('"aaron".match(x)')
        assert !@runtime.evaluate('"Aaron".match(x)')
        assert @runtime.evaluate('"john".match(y)')
        assert @runtime.evaluate('"John".match(y)')
      end

      def test_regex_roundtrips
        @runtime[:x] = /aaron/
        assert_equal(/aaron/, @runtime.evaluate('x'))

        @runtime[:x] = /aaron/m
        assert_equal(/aaron/m, @runtime.evaluate('x'))
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
jbarnette-johnson-1.0.0.200806240111 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.200807291507 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.200808062051 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.200808062111 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.200811251942 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20081126120511 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090127202936 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090225110820 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090326122910 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090326154650 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090326161333 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090402144841 test/johnson/conversions/regexp_test.rb
jbarnette-johnson-1.0.0.20090402155420 test/johnson/conversions/regexp_test.rb
johnson-1.2.0 test/johnson/conversions/regexp_test.rb
johnson-1.1.1 test/johnson/conversions/regexp_test.rb
johnson-1.1.2 test/johnson/conversions/regexp_test.rb
johnson-1.1.0 test/johnson/conversions/regexp_test.rb