mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
documentation and fixes to :through test
git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@163 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
This commit is contained in:
parent
037e9c817e
commit
e9eba10105
3 changed files with 7 additions and 3 deletions
2
README
2
README
|
@ -1,4 +1,4 @@
|
||||||
= Shoulda
|
= Shoulda - Making tests easy on the fingers and eyes
|
||||||
|
|
||||||
Shoulda makes it easy to write elegant, understandable, and maintainable tests. Shoulda consists of test macros, assertions, and helpers added on to the Test::Unit framework. It's fully compatible with your existing tests, and requires no retooling to use.
|
Shoulda makes it easy to write elegant, understandable, and maintainable tests. Shoulda consists of test macros, assertions, and helpers added on to the Test::Unit framework. It's fully compatible with your existing tests, and requires no retooling to use.
|
||||||
|
|
||||||
|
|
2
Rakefile
2
Rakefile
|
@ -14,7 +14,7 @@ end
|
||||||
|
|
||||||
Rake::RDocTask.new { |rdoc|
|
Rake::RDocTask.new { |rdoc|
|
||||||
rdoc.rdoc_dir = 'doc'
|
rdoc.rdoc_dir = 'doc'
|
||||||
rdoc.title = "Shoulda -- Making your tests easy on the fingers and eyes"
|
rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
|
||||||
rdoc.options << '--line-numbers' << '--inline-source'
|
rdoc.options << '--line-numbers' << '--inline-source'
|
||||||
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
||||||
rdoc.rdoc_files.include('README', 'lib/**/*.rb')
|
rdoc.rdoc_files.include('README', 'lib/**/*.rb')
|
||||||
|
|
|
@ -276,7 +276,11 @@ module ThoughtBot # :nodoc:
|
||||||
reflection = klass.reflect_on_association(association)
|
reflection = klass.reflect_on_association(association)
|
||||||
assert reflection
|
assert reflection
|
||||||
assert_equal :has_many, reflection.macro
|
assert_equal :has_many, reflection.macro
|
||||||
assert_equal(through, reflection.options[:through]) if through
|
if through
|
||||||
|
through_reflection = klass.reflect_on_association(through)
|
||||||
|
assert through_reflection
|
||||||
|
assert_equal(through, reflection.options[:through])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue