Sha256: aaae14767360141f08fb984a51d7cc5591a0dc22e74dadc54fa075de51ca8e42

Contents?: true

Size: 650 Bytes

Versions: 10

Compression:

Stored size: 650 Bytes

Contents

#
# This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
# Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
#

require "spec_helper"

describe Lazier::Boolean do
  before(:all) do
    ::Lazier.load!(:boolean)
  end

  describe "#to_i" do
    it "should return 1 for true" do
      expect(true.to_i).to eq(1)
    end

    it "should return 0 for false" do
      expect(false.to_i).to eq(0)
    end
  end

  describe "#value" do
    it "should return self" do
      expect(true.value).to be_truthy
      expect(false.value).to be_falsey
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lazier-4.2.2 spec/lazier/boolean_spec.rb
lazier-4.2.1 spec/lazier/boolean_spec.rb
lazier-4.2.0 spec/lazier/boolean_spec.rb
lazier-4.1.0 spec/lazier/boolean_spec.rb
lazier-4.0.6 spec/lazier/boolean_spec.rb
lazier-4.0.5 spec/lazier/boolean_spec.rb
lazier-4.0.4 spec/lazier/boolean_spec.rb
lazier-4.0.3 spec/lazier/boolean_spec.rb
lazier-4.0.2 spec/lazier/boolean_spec.rb
lazier-4.0.1 spec/lazier/boolean_spec.rb