Sha256: 04db1890860b4d0dc31390046248685772365834049b893029b3f08efa3e492e

Contents?: true

Size: 822 Bytes

Versions: 8

Compression:

Stored size: 822 Bytes

Contents

require 'spec_helper'

module Kosher
  describe Availability do
    before do
      @availability = Availability.new
    end

    describe "#kosher?" do
      before do
        Availability.threshold = 48
      end

      context "when available within threshold" do
        before do
          @availability.hours = 48
        end

        it "returns true" do
          @availability.should be_kosher
        end
      end

      context "when not available within threshold" do
        before do
          @availability.hours = 96
        end

        it "should return false" do
          @availability.should_not be_kosher
        end
      end

      context "when availability is not known" do
        it "should return false" do
          @availability.should_not be_kosher
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kosher-0.8.0 spec/kosher/availability_spec.rb
kosher-0.7.0 spec/kosher/availability_spec.rb
kosher-0.6.2 spec/kosher/availability_spec.rb
kosher-0.6.1 spec/kosher/availability_spec.rb
kosher-0.6.0 spec/kosher/availability_spec.rb
kosher-0.5.0 spec/kosher/availability_spec.rb
kosher-0.4.0 spec/kosher/availability_spec.rb
kosher-0.3.0 spec/kosher/availability_spec.rb