Permalink
Browse files

Add register_spec_type test coverage

  • Loading branch information...
1 parent b2e5db9 commit 52db1f914843049dc4c49730c7030b94e8f1d881 @blowmage blowmage committed Sep 24, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 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

0 comments on commit 52db1f9

Please sign in to comment.