spec/mvcli/form/input_spec.rb in mvcli-0.0.14 vs spec/mvcli/form/input_spec.rb in mvcli-0.0.16
- old
+ new
@@ -70,10 +70,15 @@
context "when accessing a nil value and no default" do
When(:value) {input.value field: nil}
Then {value.nil?}
end
end
-
+ describe "with a decoding dependeant on context" do
+ Given(:context) { double(:count => 2) }
+ Given(:block) { ->(s) {s * count} }
+ When(:value) { input.value({field: '3'}, context) }
+ Then { value == '33' }
+ end
describe "with a default" do
Given(:options) {{default: 5}}
context "when accesing nil" do
When(:value) {input.value field: nil}
Then {value == 5}