Skip to content
This repository

Allow "Widget\s?Acceptance" and "Widget\?Integration" too. #84

Merged
merged 1 commit into from over 1 year ago

2 participants

Mario Uher blowmage
Mario Uher

No description provided.

lib/minitest/rails/action_dispatch.rb
... ... @@ -33,8 +33,7 @@ def url_options
33 33 end
34 34
35 35 # Register by name
36   - register_spec_type(/Acceptance ?Test\z/i, self)
37   - register_spec_type(/Integration ?Test\z/i, self)
  36 + register_spec_type(Regexp.union(/Acceptance( ?Test)?\z/i, /Integration( ?Test)?\z/i), self)
1
blowmage Owner

Please change the regex to this: /(Acceptance|Integration)( ?Test)?\z/i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Mario Uher haihappen Allow "Widget\s?Acceptance" and "Widget\?Integration" too.
Call register_spec_type only once.

Merged the two regexps.
ef774dc
Mario Uher

Done!

blowmage blowmage merged commit 91297fa into from
blowmage
Owner

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 16, 2012
Mario Uher haihappen Allow "Widget\s?Acceptance" and "Widget\?Integration" too.
Call register_spec_type only once.

Merged the two regexps.
ef774dc
This page is out of date. Refresh to see the latest.
3  lib/minitest/rails/action_dispatch.rb
@@ -33,8 +33,7 @@ def url_options
33 33 end
34 34
35 35 # Register by name
36   - register_spec_type(/Acceptance ?Test\z/i, self)
37   - register_spec_type(/Integration ?Test\z/i, self)
  36 + register_spec_type(/(Acceptance|Integration)( ?Test)?\z/i, self)
38 37 end
39 38 end
40 39 end
8 test/rails/action_dispatch/test_spec_type.rb
@@ -15,9 +15,13 @@ def refute_dispatch actual
15 15 def test_spec_type_resolves_for_matching_acceptance_strings
16 16 assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptanceTest")
17 17 assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance Test")
  18 + assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptance")
  19 + assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance")
18 20 # And is not case sensitive
19 21 assert_dispatch MiniTest::Spec.spec_type("widgetacceptancetest")
20 22 assert_dispatch MiniTest::Spec.spec_type("widget acceptance test")
  23 + assert_dispatch MiniTest::Spec.spec_type("widgetacceptance")
  24 + assert_dispatch MiniTest::Spec.spec_type("widget acceptance")
21 25 end
22 26
23 27 def test_spec_type_wont_match_non_space_characters_acceptance
@@ -32,9 +36,13 @@ def test_spec_type_wont_match_non_space_characters_acceptance
32 36 def test_spec_type_resolves_for_matching_integration_strings
33 37 assert_dispatch MiniTest::Spec.spec_type("WidgetIntegrationTest")
34 38 assert_dispatch MiniTest::Spec.spec_type("Widget Integration Test")
  39 + assert_dispatch MiniTest::Spec.spec_type("WidgetIntegration")
  40 + assert_dispatch MiniTest::Spec.spec_type("Widget Integration")
35 41 # And is not case sensitive
36 42 assert_dispatch MiniTest::Spec.spec_type("widgetintegrationtest")
37 43 assert_dispatch MiniTest::Spec.spec_type("widget integration test")
  44 + assert_dispatch MiniTest::Spec.spec_type("widgetintegration")
  45 + assert_dispatch MiniTest::Spec.spec_type("widget integration")
38 46 end
39 47
40 48 def test_spec_type_wont_match_non_space_characters_integration

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.