Sha256: 6174fc806d0051dee2943b0f22dd0bb761e1c275cc1831340b5d720dd8a6384d

Contents?: true

Size: 746 Bytes

Versions: 11

Compression:

Stored size: 746 Bytes

Contents

require 'spec_helper'

module Kosher
  describe Condition do
    describe "#to_i" do
      def this(str)
        Condition.new(str).to_i
      end

      it "casts as integer" do
        this('new').should eql 1
        this('mint').should eql 2
        this('verygood').should eql 3
        this('good').should eql 4
        this('acceptable').should eql 5
      end

      it "casts unrecognized conditions as 6" do
        this('refurbished').should eql 6
      end
    end

    describe "#kosher?" do
      it "returns true if condition is good or better" do
        Condition.new('verygood').should be_kosher
        Condition.new('good').should be_kosher
        Condition.new('acceptable').should_not be_kosher
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
fassbinder-0.0.1 spec/fassbinder/condition_spec.rb
kosher-0.1.12 spec/kosher/condition_spec.rb
kosher-0.1.11 spec/kosher/condition_spec.rb
kosher-0.1.10 spec/kosher/condition_spec.rb
kosher-0.1.9 spec/kosher/condition_spec.rb
kosher-0.1.8 spec/kosher/condition_spec.rb
kosher-0.1.7 spec/kosher/condition_spec.rb
kosher-0.1.6 spec/kosher/condition_spec.rb
kosher-0.1.5 spec/kosher/condition_spec.rb
kosher-0.1.4 spec/kosher/condition_spec.rb
kosher-0.1.3 spec/kosher/condition_spec.rb