public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
Style changes for last commit.
tsaleh (author)
Sat Sep 20 12:42:07 -0700 2008
commit  b6069f736d4160068574461677e945585bc95a3d
tree    814c354e3c2020a50d5d6d0becd07115a51a5dd4
parent  a62c376628d01773899305b05e9be03f28d79e9f
...
109
110
111
112
 
 
 
113
114
115
116
 
117
118
119
...
109
110
111
 
112
113
114
115
 
 
 
116
117
118
119
0
@@ -109,11 +109,11 @@ module ThoughtBot # :nodoc:
0
         def should_assign_to(*names)
0
           opts = names.extract_options!
0
           names.each do |name|
0
- should "assign @#{name}" do
0
+ test_name = "assign @#{name}"
0
+ test_name << " as #{opts[:class]}" if opts[:class]
0
+ should test_name do
0
               assert assigns(name.to_sym), "The action isn't assigning to @#{name}"
0
- unless opts[:class].nil?
0
- assert_kind_of opts[:class], assigns(name.to_sym)
0
- end
0
+ assert_kind_of opts[:class], assigns(name.to_sym) if opts[:class]
0
             end
0
           end
0
         end

Comments

    No one has commented yet.