spec/configurable.rb in mattock-0.7.1 vs spec/configurable.rb in mattock-0.8.0

- old
+ new

@@ -33,10 +33,17 @@ hash = subject.to_hash hash[:one].should == 1 hash[:two][:a].should == "a" end + it "#from_hash" do + subject.from_hash({:one => 111, "two" => { :a => "aaa" }}) + + subject.one.should == 111 + subject.two.a.should == "aaa" + end + it "should complain about unset required fields" do expect do subject.check_required end.to raise_error end @@ -113,11 +120,11 @@ end it "should complain about missing fields" do expect do subject.check_required - end.to raise_error /Required field/ + end.to raise_error(/Required field/) end it "should inspect cleanly" do subject.inspect.should be_a(String) end @@ -132,10 +139,10 @@ end it "should complain about missing fields" do expect do subject.check_required - end.to raise_error /Required field/ + end.to raise_error(/Required field/) end end describe "with required paths configured" do def subject