Sha256: ead93bd750091d0561366690864940a4104dabb848007b627ea158eda462245a

Contents?: true

Size: 639 Bytes

Versions: 3

Compression:

Stored size: 639 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 https://choosealicense.com/licenses/mit.
#

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

3 entries across 3 versions & 1 rubygems

Version Path
lazier-4.2.9 spec/lazier/boolean_spec.rb
lazier-4.2.8 spec/lazier/boolean_spec.rb
lazier-4.2.3 spec/lazier/boolean_spec.rb