Sha256: baba6b8a0854f7f968d48250b1a12ba7d6e2f41db8a7df8353fc979189dfb4e7

Contents?: true

Size: 495 Bytes

Versions: 7

Compression:

Stored size: 495 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Necromancer::BooleanConverters::IntegerToBooleanConverter, '.call' do

  subject(:converter) { described_class.new }

  it "converts 1 to true value" do
    expect(converter.call(1)).to eq(true)
  end

  it "converts 0 to false value" do
    expect(converter.call(0)).to eq(false)
  end

  it "fails to convert in strict mode" do
    expect  {
      converter.call('1', strict: true)
    }.to raise_error(Necromancer::ConversionTypeError)
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/boolean/integer_to_boolean_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/boolean/integer_to_boolean_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/boolean/integer_to_boolean_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/boolean/integer_to_boolean_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/boolean/integer_to_boolean_spec.rb
necromancer-0.5.1 spec/unit/converters/boolean/integer_to_boolean_spec.rb
necromancer-0.5.0 spec/unit/converters/boolean/integer_to_boolean_spec.rb