spec/loopiator/credits_spec.rb in loopiator-0.2.0 vs spec/loopiator/credits_spec.rb in loopiator-0.3.0

- old
+ new

@@ -1,28 +1,27 @@ # encoding: UTF-8 require File.expand_path('../../spec_helper', __FILE__) -describe "Credits Management -" do +describe "Credits Management" do - before(:each) do + before :each do @client = Loopiator::Client.new end - describe "When managing my credits:" do - + after :each do + Loopiator.reset + end + + context "When managing my credits:" do it "I should be able to check how many credits I currently have (with VAT)" do - @client.expects(:get_credits_amount).with(true).once.returns(125) - remaining_credits = @client.get_credits_amount(true) - remaining_credits.should == 125 + expect(@client).to receive(:get_credits_amount).with(include_vat: true).and_return(125) + expect(@client.get_credits_amount(include_vat: true)).to be == 125 end it "I should be able to check how many credits I currently have (without VAT)" do - @client.expects(:get_credits_amount).with(false).once.returns(100) - remaining_credits = @client.get_credits_amount(false) - remaining_credits.should == 100 + expect(@client).to receive(:get_credits_amount).with(include_vat: false).and_return(100) + expect(@client.get_credits_amount(include_vat: false)).to be == 100 end - end -end - +end \ No newline at end of file