spec/unit/operator/non_relational/test_defaults.rb in alf-0.9.3 vs spec/unit/operator/non_relational/test_defaults.rb in alf-0.10.0
- old
+ new
@@ -42,14 +42,27 @@
{:a => 3, :b => "b"},
{:a => 1, :b => "b"},
]}
describe "When factored with Lispy" do
- let(:operator){ Lispy.defaults(input, {:a => 1, :b => "b"}, true) }
+ let(:operator){ Lispy.defaults(input, {:a => 1, :b => "b"}, :strict => true) }
it{ should == expected }
end
end
+
+ describe "when used with tuple expressions" do
+ let(:input) {[
+ {:a => nil, :b => "b"},
+ ]}
+ let(:expected) {[
+ {:a => "b", :b => "b"},
+ ]}
+ let(:operator){
+ Lispy.defaults(input, {:a => TupleExpression.coerce("b")})
+ }
+ it{ should == expected }
+ end
end
end
-end
\ No newline at end of file
+end