mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Added a test for the model_class private helper
This commit is contained in:
parent
cc61627a52
commit
8fb6041b61
1 changed files with 9 additions and 1 deletions
|
@ -9,7 +9,7 @@ class PrivateHelpersTest < Test::Unit::TestCase # :nodoc:
|
|||
assert_equal [:a, :b], args
|
||||
end
|
||||
|
||||
should "return wanted opts in order" do
|
||||
should "return wanted opts in order" do
|
||||
args = [{:one => 1, :two => 2}]
|
||||
one, two = get_options!(args, :one, :two)
|
||||
assert_equal 1, one
|
||||
|
@ -23,4 +23,12 @@ class PrivateHelpersTest < Test::Unit::TestCase # :nodoc:
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ::SomeModel; end
|
||||
context "model_class" do
|
||||
should "sniff the class constant from the test class" do
|
||||
self.expects(:name).returns("SomeModelTest")
|
||||
assert_equal SomeModel, model_class
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue