spec/example_beautified.rb in ruby-beautify-0.94.2 vs spec/example_beautified.rb in ruby-beautify-0.95.0
- old
+ new
@@ -120,5 +120,27 @@
rejected
end
rescue
'FALSE'
end
+
+# Test or-equals
+def expensive_value
+ @expensive_value ||= begin
+ if conn.active?
+ expensive_call
+ else
+ :none
+ end
+ end
+end
+
+# Test multiple or-equals
+def expensive_value
+ @expensive_value ||= @cached_value ||= begin
+ if conn.active?
+ expensive_call
+ else
+ :none
+ end
+ end
+end