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
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/journey-1.0.4/test/router/test_strexp.rb
swipe-rails-0.0.5 vendor/bundle/gems/journey-1.0.4/test/router/test_strexp.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
font-awesome-rails-3.1.1.2 vendor/ruby/2.0.0/gems/journey-1.0.4/test/router/test_strexp.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
font-awesome-rails-3.1.1.1 vendor/ruby/2.0.0/gems/journey-1.0.4/test/router/test_strexp.rb
challah-1.0.0.beta3 vendor/bundle/gems/journey-1.0.4/test/router/test_strexp.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
challah-1.0.0.beta2 vendor/bundle/gems/journey-1.0.4/test/router/test_strexp.rb
challah-1.0.0.beta vendor/bundle/gems/journey-1.0.4/test/router/test_strexp.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/test/router/test_strexp.rb