test/RubyLess/basic.yml in rubyless-0.8.7 vs test/RubyLess/basic.yml in rubyless-0.8.8
- old
+ new
@@ -51,31 +51,35 @@
src: "spouse.id > 1"
tem: "(node.spouse ? (node.spouse.zip>1) : nil)"
nil_ternary_op:
src: "spouse ? 'foo' : 'bar'"
- tem: "node.spouse ? \"foo\" : \"bar\""
+ tem: "(node.spouse ? \"foo\" : \"bar\")"
res: 'bar'
nested_ternary_op:
src: "spouse.name == 'Adam' ? 'man' : 'not a man'"
- tem: "(node.spouse ? (node.spouse.name==\"Adam\") : nil) ? \"man\" : \"not a man\""
+ tem: "((node.spouse ? (node.spouse.name==\"Adam\") : nil) ? \"man\" : \"not a man\")"
res: "not a man"
+one_minus_ternary_op:
+ src: "1 - (node.id == 0 ? 5 : node.id)"
+ tem: "(1-((node.zip==0) ? 5 : node.zip))"
+
method_on_method:
src: "project.name.to_s"
tem: "node.project.name.to_s"
res: 'project'
comp_ternary_op:
src: "1 > 2 ? 'foo' : 'bar'"
- tem: "(1>2) ? \"foo\" : \"bar\""
+ tem: "((1>2) ? \"foo\" : \"bar\")"
res: "bar"
method_ternary_op:
src: "id > 2 ? 'foo' : 'bar'"
- tem: "(node.zip>2) ? \"foo\" : \"bar\""
+ tem: "((node.zip>2) ? \"foo\" : \"bar\")"
res: "foo"
method_argument_can_be_nil:
src: "vowel_count(spouse.name)"
tem: "(node.spouse ? vowel_count(node.spouse.name) : nil)"
@@ -271,7 +275,7 @@
src: 'nil'
tem: 'nil'
nil_in_op:
src: '(dictionary[:foo] == "something" ? "foo" : nil)'
- tem: '(get_dict[:foo]=="something") ? "foo" : nil'
+ tem: '((get_dict[:foo]=="something") ? "foo" : nil)'
res: ''
\ No newline at end of file