spec/hippo_spec.rb in hippoload-0.0.1 vs spec/hippo_spec.rb in hippoload-0.0.2
- old
+ new
@@ -9,14 +9,19 @@
:connections => 100,
:rate => 10,
:uri => "/posts",
:connections_and_rates => [{ :connections => 100, :rate => 10 }]
}
+
end
+ let(:wrong_arg) {['worng_arg']}
+
describe "Hippo#attributes_methods" do
+ # These tests are tested using real database with the httperf tool
+
it "should have attributes reader" do
hippo = Hippoload::Hippo.new(basic_conf)
hippo.connections.should eql(100)
hippo.rate.should eql(10)
hippo.server.should eql('localhost')
@@ -25,9 +30,13 @@
hippo.connections_and_rates.should nil
end
it "should raise error if wrong conf passed" do
expect { Hippoload::Hippo.new(wrong_conf) }.to raise_error
+ end
+
+ it "should raise error if wrong argument passed" do
+ expect { Hippoload::Hippo.new(wrong_arg) }.to raise_error
end
it "should not raise error if correct conf passed" do
expect { Hippoload::Hippo.new(basic_conf) }.to_not raise_error
end