aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-09-25 09:26:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-09-25 09:26:42 -0700
commitc96b20f8d985c6fa87a8efda7a4884e3c35e5739 (patch)
tree4fd35e201d0636a50c398525d81e62b8adba536a /actionpack/test/dispatch
parenta05a079c109ebbafd8112be0044c9d82b4a28d97 (diff)
parent64f254ccf74242453421d0c495388293dbc06c71 (diff)
downloadrails-c96b20f8d985c6fa87a8efda7a4884e3c35e5739.tar.gz
rails-c96b20f8d985c6fa87a8efda7a4884e3c35e5739.tar.bz2
rails-c96b20f8d985c6fa87a8efda7a4884e3c35e5739.zip
Merge pull request #7749 from blowmage/minitest
Improve support for minitest's spec DSL
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/spec_type_test.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/spec_type_test.rb b/actionpack/test/dispatch/spec_type_test.rb
new file mode 100644
index 0000000000..6cd19fd333
--- /dev/null
+++ b/actionpack/test/dispatch/spec_type_test.rb
@@ -0,0 +1,41 @@
+require "abstract_unit"
+
+class SpecTypeTest < ActiveSupport::TestCase
+ def assert_dispatch actual
+ assert_equal ActionDispatch::IntegrationTest, actual
+ end
+
+ def refute_dispatch actual
+ refute_equal ActionDispatch::IntegrationTest, actual
+ end
+
+ 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("widgetacceptancetest")
+ assert_dispatch MiniTest::Spec.spec_type("widget acceptance test")
+ end
+
+ def test_spec_type_wont_match_non_space_characters_acceptance
+ refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\tTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\rTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\nTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\fTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget AcceptanceXTest")
+ end
+
+ 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("widgetintegrationtest")
+ assert_dispatch MiniTest::Spec.spec_type("widget integration test")
+ end
+
+ def test_spec_type_wont_match_non_space_characters_integration
+ refute_dispatch MiniTest::Spec.spec_type("Widget Integration\tTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget Integration\rTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget Integration\nTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget Integration\fTest")
+ refute_dispatch MiniTest::Spec.spec_type("Widget IntegrationXTest")
+ end
+end