spec/nsisam_spec.rb in nsisam-0.3.3 vs spec/nsisam_spec.rb in nsisam-0.3.4

- old
+ new

@@ -10,9 +10,16 @@ after :all do @fake_sam.stop_server end + context "cannot connect to server" do + it "throws error if couldn't connect to the server" do + sam = NSISam::Client.new 'http://test:test@localhost:4000' + expect { sam.store('anything') }.to raise_error(NSISam::Errors::Client::ConnectionRefusedError) + end + end + context "storing" do it "can store a value in SAM" do response = @nsisam.store("something") response.should_not be_nil response.should have_key("key")