Sha256: 0f64d68fe0637d0126595c03bbd896e4454620b68ca00ea7192dd93579c7fee6

Contents?: true

Size: 977 Bytes

Versions: 24

Compression:

Stored size: 977 Bytes

Contents

require 'spec_helper'

module Kosher
  describe Item do
    before do
      @item = Item.new
    end

    describe "#kosher?" do
      context "when condition is kosher" do
        before do
          @item.condition = Condition.new(1)
        end

        context "when description is kosher" do
          before do
            @item.description = Description.new('')
          end

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

        context "when description is not kosher" do
          before do
            @item.description = Description.new('Withdrawn library book')
          end

          it "returns false" do
            @item.should_not be_kosher
          end
        end
      end

      context "when condition is not kosher" do
        before do
          @item.condition = Condition.new(5)
        end

        it "returns false" do
          @item.should_not be_kosher
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
kosher-0.2.24 spec/kosher/item_spec.rb
kosher-0.2.23 spec/kosher/item_spec.rb
kosher-0.2.22 spec/kosher/item_spec.rb
kosher-0.2.21 spec/kosher/item_spec.rb
kosher-0.2.20 spec/kosher/item_spec.rb
kosher-0.2.19 spec/kosher/item_spec.rb
kosher-0.2.18 spec/kosher/item_spec.rb
kosher-0.2.17 spec/kosher/item_spec.rb
kosher-0.2.16 spec/kosher/item_spec.rb
kosher-0.2.15 spec/kosher/item_spec.rb
kosher-0.2.14 spec/kosher/item_spec.rb
kosher-0.2.13 spec/kosher/item_spec.rb
kosher-0.2.12 spec/kosher/item_spec.rb
kosher-0.2.11 spec/kosher/item_spec.rb
kosher-0.2.10 spec/kosher/item_spec.rb
kosher-0.2.9 spec/kosher/item_spec.rb
kosher-0.2.8 spec/kosher/item_spec.rb
kosher-0.2.7 spec/kosher/item_spec.rb
kosher-0.2.6 spec/kosher/item_spec.rb
kosher-0.2.5 spec/kosher/item_spec.rb