aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/spec_type_test.rb
diff options
context:
space:
mode:
authorMike Moore <mike@blowmage.com>2012-09-24 14:24:08 -0600
committerMike Moore <mike@blowmage.com>2012-09-24 14:24:08 -0600
commit52db1f914843049dc4c49730c7030b94e8f1d881 (patch)
tree4abe578f23359c70c592ce9ce0bdb4c2300ed678 /activesupport/test/spec_type_test.rb
parentb2e5db9c719bcbddc4777c31df6220e8d0a8c307 (diff)
downloadrails-52db1f914843049dc4c49730c7030b94e8f1d881.tar.gz
rails-52db1f914843049dc4c49730c7030b94e8f1d881.tar.bz2
rails-52db1f914843049dc4c49730c7030b94e8f1d881.zip
Add register_spec_type test coverage
Diffstat (limited to 'activesupport/test/spec_type_test.rb')
-rw-r--r--activesupport/test/spec_type_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/activesupport/test/spec_type_test.rb b/activesupport/test/spec_type_test.rb
new file mode 100644
index 0000000000..95a982d8fd
--- /dev/null
+++ b/activesupport/test/spec_type_test.rb
@@ -0,0 +1,23 @@
+require "abstract_unit"
+require "active_record"
+
+class SomeRandomModel < ActiveRecord::Base; end
+
+class SpecTypeTest < ActiveSupport::TestCase
+
+ def assert_support actual
+ assert_equal ActiveSupport::TestCase, actual
+ end
+
+ def assert_spec actual
+ assert_equal MiniTest::Spec, actual
+ end
+
+ def test_spec_type_resolves_for_actitive_record_constants
+ assert_support MiniTest::Spec.spec_type(SomeRandomModel)
+ end
+
+ def test_spec_type_doesnt_resolve_random_strings
+ assert_spec MiniTest::Spec.spec_type("Unmatched String")
+ end
+end