Sha256: 244ac62a7b9eb68bc1af170411567070bff2fdeb536bb4d51bc2bdce35ef5069

Contents?: true

Size: 603 Bytes

Versions: 6

Compression:

Stored size: 603 Bytes

Contents

require 'rubygems'
require 'spec'

$: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
require 'amalgalite'
require 'amalgalite/boolean'

describe Amalgalite::Boolean do
  %w[ True Y Yes T 1 ].each do |v|
    it "converts #{v} to true" do
      Amalgalite::Boolean.to_bool(v).should == true
    end
  end

  %w[ False F f No n 0 ].each do |v|
    it "converts #{v} to false " do
      Amalgalite::Boolean.to_bool(v).should == false
    end
  end

  %w[ other things nil ].each do |v|
    it "converts #{v} to nil" do
      Amalgalite::Boolean.to_bool(v).should == nil
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amalgalite-0.1.0 spec/boolean_spec.rb
amalgalite-0.2.0 spec/boolean_spec.rb
amalgalite-0.2.2 spec/boolean_spec.rb
amalgalite-0.2.1 spec/boolean_spec.rb
amalgalite-0.2.3 spec/boolean_spec.rb
amalgalite-0.2.4 spec/boolean_spec.rb