spec/bamboo-client/remote_spec.rb in bamboo-client-0.1.6 vs spec/bamboo-client/remote_spec.rb in bamboo-client-0.1.7
- old
+ new
@@ -2,14 +2,14 @@
module Bamboo
module Client
describe Remote do
let(:url) { "http://bamboo.example.com" }
- let(:http) { mock(Http::Xml) }
+ let(:http) { double(Http::Xml) }
let(:client) { Remote.new(http) }
let(:document) {
- m = mock(Http::Xml::Doc)
+ m = double(Http::Xml::Doc)
m.stub(:css).with("errors error").and_return []
m
}
@@ -134,11 +134,11 @@
client.recently_completed_results_for_build("fake-key").should == %w[some results]
end
end # API calls
describe Remote::Build do
- let(:client) { mock(Remote) }
+ let(:client) { double(Remote) }
let(:doc) { xml_fixture("build").css("build").first }
let(:build) { Remote::Build.new(doc, client) }
it "should know if the build is enabled" do
build.should be_enabled
@@ -212,15 +212,15 @@
it "should have a start time" do
result.start_time.should == Time.parse("2011-01-18 09:55:54")
end
it "returns nil if start time can not be parsed" do
- doc.stub(:css).and_return mock(:text => "Sun Sep 32")
+ doc.stub(:css).and_return double(:text => "Sun Sep 32")
result.start_time.should be_nil
end
it "returns nil if start time can not be parsed" do
- doc.stub(:css).and_return mock(:text => "Sun Sep 32")
+ doc.stub(:css).and_return double(:text => "Sun Sep 32")
result.end_time.should be_nil
end
it "should have an end time" do
result.end_time.should == Time.parse("2011-01-18T09:56:40+0100")