aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-29 15:45:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-29 15:45:42 -0700
commitda2cf937aa68c2470c0d4a73c29fe3555b2667c0 (patch)
tree6fd83631fce62e70477025c30593b808e84df429
parentbb207ea7b6df6101860d5de6e47ad0e0f1ea2cdf (diff)
downloadrails-da2cf937aa68c2470c0d4a73c29fe3555b2667c0.tar.gz
rails-da2cf937aa68c2470c0d4a73c29fe3555b2667c0.tar.bz2
rails-da2cf937aa68c2470c0d4a73c29fe3555b2667c0.zip
no more is_a checks on instantiation
-rw-r--r--actionpack/lib/action_dispatch/journey/path/pattern.rb13
-rw-r--r--actionpack/test/journey/path/pattern_test.rb4
2 files changed, 4 insertions, 13 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb
index c39f8e850a..3af940a02f 100644
--- a/actionpack/lib/action_dispatch/journey/path/pattern.rb
+++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -11,15 +11,10 @@ module ActionDispatch
end
def initialize(strexp)
- case strexp
- when Router::Strexp
- @spec = strexp.ast
- @requirements = strexp.requirements
- @separators = strexp.separators.join
- @anchored = strexp.anchor
- else
- raise ArgumentError, "Bad expression: #{strexp}"
- end
+ @spec = strexp.ast
+ @requirements = strexp.requirements
+ @separators = strexp.separators.join
+ @anchored = strexp.anchor
@names = nil
@optional_names = nil
diff --git a/actionpack/test/journey/path/pattern_test.rb b/actionpack/test/journey/path/pattern_test.rb
index cdb3cdad7b..9dfdfc23ed 100644
--- a/actionpack/test/journey/path/pattern_test.rb
+++ b/actionpack/test/journey/path/pattern_test.rb
@@ -75,10 +75,6 @@ module ActionDispatch
end
end
- def test_to_raise_exception_with_bad_expression
- assert_raise(ArgumentError, "Bad expression: []") { Pattern.new [] }
- end
-
def test_to_regexp_with_extended_group
strexp = Router::Strexp.build(
'/page/:name',