Skip to content

Commit

Permalink
update mocks for changes to parsing of location headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Jan 19, 2012
1 parent 3aa8414 commit 8ea78ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions spec/data_item_value_history_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@
@connection.should_receive(:put).with(MockDataItemPath+"/127612FA4922", :value => 6, :startDate => AMEE::Epoch+1).once.and_return(flexmock(:body => '')) @connection.should_receive(:put).with(MockDataItemPath+"/127612FA4922", :value => 6, :startDate => AMEE::Epoch+1).once.and_return(flexmock(:body => ''))
@connection.should_receive(:delete).with(MockDataItemPath+"/127612FA4923").once.and_return(flexmock(:body => '')) @connection.should_receive(:delete).with(MockDataItemPath+"/127612FA4923").once.and_return(flexmock(:body => ''))
@connection.should_receive(:post).with(MockDataItemPath, @connection.should_receive(:post).with(MockDataItemPath,
:kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return({'Location'=>'http://foo.com/'}) :kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return(flexmock(:headers_hash => {'Location'=>'http://foo.com/'}))
@connection.should_receive(:post).with(MockDataItemPath, @connection.should_receive(:post).with(MockDataItemPath,
:kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return({'Location'=>'http://foo.com/'}) :kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return(flexmock(:headers_hash => {'Location'=>'http://foo.com/'}))
lambda { lambda {
@val.series = TestSeriesTwo @val.series = TestSeriesTwo
@val.save! @val.save!
Expand All @@ -289,9 +289,9 @@
@connection.should_receive(:put).with(MockDataItemPath+"/127612FA4922", :value => 6, :startDate => AMEE::Epoch+1).once.and_return(flexmock(:body => '')) @connection.should_receive(:put).with(MockDataItemPath+"/127612FA4922", :value => 6, :startDate => AMEE::Epoch+1).once.and_return(flexmock(:body => ''))
@connection.should_receive(:delete).with(MockDataItemPath+"/127612FA4923").once.and_return(flexmock(:body => '')) @connection.should_receive(:delete).with(MockDataItemPath+"/127612FA4923").once.and_return(flexmock(:body => ''))
@connection.should_receive(:post).with(MockDataItemPath, @connection.should_receive(:post).with(MockDataItemPath,
:kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return({'Location'=>'https://foo.com/'}) :kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return(flexmock(:headers_hash => {'Location'=>'https://foo.com/'}))
@connection.should_receive(:post).with(MockDataItemPath, @connection.should_receive(:post).with(MockDataItemPath,
:kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return({'Location'=>'https://foo.com/'}) :kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return(flexmock(:headers_hash => {'Location'=>'https://foo.com/'}))
lambda { lambda {
@val.series = TestSeriesTwo @val.series = TestSeriesTwo
@val.save! @val.save!
Expand Down
4 changes: 2 additions & 2 deletions spec/data_item_value_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
with(MockResourceDataItemPath, with(MockResourceDataItemPath,
:kgCO2PerPassengerJourney=>42, :kgCO2PerPassengerJourney=>42,
:startDate=>(AMEE::Epoch+3).xmlschema). :startDate=>(AMEE::Epoch+3).xmlschema).
and_return({'Location'=>'http://foo.com/'}) and_return(flexmock(:headers_hash => {'Location'=>'http://foo.com/'}))
@new=AMEE::Data::ItemValue.new(:value=>42, @new=AMEE::Data::ItemValue.new(:value=>42,
:start_date=>AMEE::Epoch+3, :start_date=>AMEE::Epoch+3,
:connection=>@connection, :connection=>@connection,
Expand All @@ -221,7 +221,7 @@
with(MockResourceDataItemPath, with(MockResourceDataItemPath,
:kgCO2PerPassengerJourney=>42, :kgCO2PerPassengerJourney=>42,
:startDate=>(AMEE::Epoch+3).xmlschema). :startDate=>(AMEE::Epoch+3).xmlschema).
and_return({'Location'=>'https://foo.com/'}) and_return(flexmock(:headers_hash => {'Location'=>'https://foo.com/'}))
@new=AMEE::Data::ItemValue.new(:value=>42, @new=AMEE::Data::ItemValue.new(:value=>42,
:start_date=>AMEE::Epoch+3, :start_date=>AMEE::Epoch+3,
:connection=>@connection, :connection=>@connection,
Expand Down
Loading

0 comments on commit 8ea78ca

Please sign in to comment.