Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #84 from haihappen/regexps

Update spec name regex to make "Test" optional.
  • Loading branch information...
commit 91297faee6b008473aac0c39192d196331fd3caa 2 parents b083d0b + ef774dc
@blowmage authored
View
3  lib/minitest/rails/action_dispatch.rb
@@ -33,8 +33,7 @@ def url_options
end
# Register by name
- register_spec_type(/Acceptance ?Test\z/i, self)
- register_spec_type(/Integration ?Test\z/i, self)
+ register_spec_type(/(Acceptance|Integration)( ?Test)?\z/i, self)
end
end
end
View
8 test/rails/action_dispatch/test_spec_type.rb
@@ -15,9 +15,13 @@ def refute_dispatch actual
def test_spec_type_resolves_for_matching_acceptance_strings
assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptanceTest")
assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance Test")
+ assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptance")
+ assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance")
# And is not case sensitive
assert_dispatch MiniTest::Spec.spec_type("widgetacceptancetest")
assert_dispatch MiniTest::Spec.spec_type("widget acceptance test")
+ assert_dispatch MiniTest::Spec.spec_type("widgetacceptance")
+ assert_dispatch MiniTest::Spec.spec_type("widget acceptance")
end
def test_spec_type_wont_match_non_space_characters_acceptance
@@ -32,9 +36,13 @@ def test_spec_type_wont_match_non_space_characters_acceptance
def test_spec_type_resolves_for_matching_integration_strings
assert_dispatch MiniTest::Spec.spec_type("WidgetIntegrationTest")
assert_dispatch MiniTest::Spec.spec_type("Widget Integration Test")
+ assert_dispatch MiniTest::Spec.spec_type("WidgetIntegration")
+ assert_dispatch MiniTest::Spec.spec_type("Widget Integration")
# And is not case sensitive
assert_dispatch MiniTest::Spec.spec_type("widgetintegrationtest")
assert_dispatch MiniTest::Spec.spec_type("widget integration test")
+ assert_dispatch MiniTest::Spec.spec_type("widgetintegration")
+ assert_dispatch MiniTest::Spec.spec_type("widget integration")
end
def test_spec_type_wont_match_non_space_characters_integration
Please sign in to comment.
Something went wrong with that request. Please try again.