Sha256: 876de1a5c4e0a47eea1897eccc74f1a011e8f9605303da2d1dafe5792cd1bfab

Contents?: true

Size: 812 Bytes

Versions: 104

Compression:

Stored size: 812 Bytes

Contents

require 'helper'

module Journey
  class Router
    class TestStrexp < MiniTest::Unit::TestCase
      def test_many_names
        exp = Strexp.new(
          "/:controller(/:action(/:id(.:format)))",
          {:controller=>/.+?/},
          ["/", ".", "?"],
          true)

        assert_equal ["controller", "action", "id", "format"], exp.names
      end

      def test_names
        {
          "/bar(.:format)"    => %w{ format },
          ":format"           => %w{ format },
          ":format-"          => %w{ format },
          ":format0"          => %w{ format0 },
          ":format1,:format2" => %w{ format1 format2 },
        }.each do |string, expected|
          exp = Strexp.new(string, {}, ["/", ".", "?"])
          assert_equal expected, exp.names
        end
      end
    end
  end
end

Version data entries

104 entries across 78 versions & 19 rubygems

Version Path
challah-0.5.2 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.5.2 vendor/bundle/gems/journey-1.0.3/test/router/test_strexp.rb
challah-0.5.1 vendor/bundle/gems/journey-1.0.3/test/router/test_strexp.rb
journey-1.0.3 test/router/test_strexp.rb
challah-0.5.0 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
journey-1.0.2 test/router/test_strexp.rb
challah-0.4.1 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.4.0 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.3.5 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.3.4 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.3.3 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.3.2 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.3.1 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.3.0 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.2.1 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
challah-0.2.0 vendor/bundle/gems/journey-1.0.1/test/router/test_strexp.rb
journey-1.0.1 test/router/test_strexp.rb
andyjeffries-journey-1.0.0.20111022124133 test/router/test_strexp.rb
andyjeffries-journey-1.0.0 test/router/test_strexp.rb
journey-1.0.0 test/router/test_strexp.rb