test/checkr/util_test.rb in checkr-official-1.0.2 vs test/checkr/util_test.rb in checkr-official-1.1.0
- old
+ new
@@ -1,8 +1,12 @@
require File.expand_path('../../test_helper', __FILE__)
+class TestObj; end
+
module Checkr
+ class TestObj; end
+
class UtilTest < Test::Unit::TestCase
should "symbolize_keys should convert keys to symbols" do
start = {
'foo' => 'bar',
'array' => [{ 'foo' => 'bar' }],
@@ -43,8 +47,13 @@
should 'query_array should convert { :a => [1, 2] } to ["a[]=1", "a[]=2"]' do
start = { :a => [1, 2] }
finish = ["a[]=1", "a[]=2"]
assert_equal(finish, Util.query_array(start))
+ end
+
+ should 'scope the class in the Checkr namespace' do
+ assert_not_equal(::TestObj, Util.constantize(:TestObj))
+ assert_equal(Checkr::TestObj, Util.constantize(:TestObj))
end
end
end