Sha256: 57a0971bce2b3585fd48f3f38b04b220d99ef5f99ed6901c9ad7495dc4e06d1d

Contents?: true

Size: 936 Bytes

Versions: 2

Compression:

Stored size: 936 Bytes

Contents

require 'spec_helper'

module Kosher
  describe Shipping do
    before do
      @shipping = Shipping.new
    end

    describe "#free?" do
      context "when shipping costs 0" do
        it "returns true" do
          @shipping.cost = Price.new(cents: 0)
          @shipping.should be_free
        end
      end

      context "when shipping is not free" do
        it "returns false" do
          @shipping.cost = Price.new(cents: 1)
          @shipping.should_not be_free
        end
      end
    end

    describe "#kosher?" do
      context "when available" do
        it "returns true" do
          @shipping.availability = Availability.new(:hours => 0)
          @shipping.should be_kosher
        end
      end

      context "when not available" do
        it "returns false" do
          @shipping.availability = Availability.new(:hours => 96)
          @shipping.should_not be_kosher
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kosher-0.8.0 spec/kosher/shipping_spec.rb
kosher-0.7.0 spec/kosher/shipping_spec.rb