Sha256: 6ca5c4e4ac215619d4b0c37e340c7217f9cfcdf4670ee6eda90ffc49e0d09db5

Contents?: true

Size: 753 Bytes

Versions: 5

Compression:

Stored size: 753 Bytes

Contents

require 'spec_helper'

describe Taxedo::Builder::Hash do
  #*************************************************************************************
  # PUBLIC INSTANCE METHODS
  #*************************************************************************************
  context "with a quebec receipt of 100$" do
    let(:receipt) { Taxedo::Region.new('quebec').calculate(10000) }

    describe "#generate" do
      let(:hash) { Taxedo::Builder::Hash.new(receipt).generate }

      the("hash[:subtotal]") { should eql 10000 }
      the("hash[:taxes][0][:id]") { should eql 'gst' }
      the("hash[:taxes][0][:amount]") { should eql 500 }
      the("hash[:taxes][1][:id]") { should eql 'qst' }
      the("hash[:total]") { should eql 11498 }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
taxedo-0.0.6 spec/taxedo/builder/hash_spec.rb
taxedo-0.0.5 spec/taxedo/builder/hash_spec.rb
taxedo-0.0.4 spec/taxedo/builder/hash_spec.rb
taxedo-0.0.3 spec/taxedo/builder/hash_spec.rb
taxedo-0.0.2 spec/taxedo/builder/hash_spec.rb