Sha256: b2cf0d22975d5db43620e658e600b73b7c5594d1e2471a109baa17538f15655f

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe true do
  subject { true }

  specify('#=> true') { expect(subject).to eql(true) }

  context '!' do
    specify('#=> false') { expect(!subject).to eql(false) }
  end

  context '==' do
    specify('true #=> true') { expect(subject == true).to eql(true) }
    specify('false #=> false') { expect(subject == false).to eql(false) }
    specify('maybe #=> maybe') { expect(subject == maybe).to eql(maybe) }
  end

  context '&' do
    specify('true #=> true') { expect(subject & true).to eql(true) }
    specify('false #=> false') { expect(subject & false).to eql(false) }
    specify('maybe #=> maybe') { expect(subject & maybe).to eql(maybe) }
  end

  context '|' do
    specify('true #=> true') { expect(subject | true).to eql(true) }
    specify('false #=> true') { expect(subject | false).to eql(true) }
    specify('maybe #=> true') { expect(subject | maybe).to eql(true) }
  end

  context '^' do
    specify('true #=> false') { expect(subject ^ true).to eql(false) }
    specify('false #=> true') { expect(subject ^ false).to eql(true) }
    specify('maybe #=> maybe') { expect(subject ^ maybe).to eql(maybe) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unboolean-0.0.2 spec/unboolean/core_ext/true_class_spec.rb