diff options
author | Milan Dobrota <mdobrota@tribune.com> | 2011-09-04 10:44:08 -0500 |
---|---|---|
committer | Milan Dobrota <mdobrota@tribune.com> | 2011-09-04 10:44:08 -0500 |
commit | 9b08afd2f4d501fb1710ba0ed4e19313093605c8 (patch) | |
tree | 93c181f5831e772f6ab044516fb36be43dbd3aa3 /actionpack/lib/action_controller/test_case.rb | |
parent | abb09054043c556ae38d2c9d1e9037eceb6dc426 (diff) | |
download | rails-9b08afd2f4d501fb1710ba0ed4e19313093605c8.tar.gz rails-9b08afd2f4d501fb1710ba0ed4e19313093605c8.tar.bz2 rails-9b08afd2f4d501fb1710ba0ed4e19313093605c8.zip |
if ... nil? is more expensive than unless
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 40332da321..a83fa74795 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -79,10 +79,10 @@ module ActionController "expecting <?> but rendering with <?>", options, rendered.keys.join(', ')) assert_block(msg) do - if options.nil? - @templates.blank? - else + if options rendered.any? { |t,num| t.match(options) } + else + @templates.blank? end end when Hash |