Sha256: 77fc2050cf9d9d5465415d20f058602b31c4722ccbdb87beccbdf73c24a347e9

Contents?: true

Size: 548 Bytes

Versions: 9

Compression:

Stored size: 548 Bytes

Contents

require "spec_helper"
require "cascade/complex_fields/boolean"

describe Cascade::ComplexFields::Boolean do
  def described_class
    Cascade::ComplexFields::Boolean
  end

  let(:subject) { described_class.new }

  it "return true value for values that seems like true" do
    ["True",  "true",  "x",  "+",  true].each do |value|
      assert subject.call(value)
    end
  end

  it "return false value for values that cant be true" do
    ["false", false, nil, "", "some value"].each do |value|
      refute subject.call(value)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cascade-rb-0.2.3 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.2.2 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.2.1 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.2.0 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.1.5 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.1.4 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.1.2 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.1.1 spec/lib/complex_fields/boolean_spec.rb
cascade-rb-0.1.0 spec/lib/complex_fields/boolean_spec.rb