spec/example_beautified.rb in ruby-beautify-0.94.1 vs spec/example_beautified.rb in ruby-beautify-0.94.2
- old
+ new
@@ -90,5 +90,35 @@
This line should not be mutated"
puts "This is multi line interpolated string #{
x
}"
end
+
+# Test to validate case statements
+def case_test opts=nil
+ case test_case
+ when 'Passing'
+ call(:pass)
+ when 'Failing'
+ call(:fail)
+ when 'Error'
+ call(:error)
+ end
+end
+
+# Test for variable assignment from an if statement
+@products = if params[:category]
+ Category.find(params[:category]).products
+else
+ Product.all
+end
+
+# Test for variable assignment from a block
+response = begin
+ if true?
+ api_call(test)
+ else
+ rejected
+ end
+rescue
+ 'FALSE'
+end