Sha256: 66764c88ca4d081ff857d0557a1568510dbad339d81139c3312efada6fee05a2

Contents?: true

Size: 444 Bytes

Versions: 7

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Necromancer::ArrayConverters::ArrayToSetConverter, '.call' do

  subject(:converter) { described_class.new(:array, :set) }

  it "converts `[:x,:y,:x,1,2,1]` to set" do
    expect(converter.call([:x,:y,:x,1,2,1])).to eql(Set[:x,:y,1,2])
  end

  it "fails to convert `1` to set" 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/array/array_to_set_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/array/array_to_set_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/array/array_to_set_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/array/array_to_set_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/necromancer-0.5.1/spec/unit/converters/array/array_to_set_spec.rb
necromancer-0.5.1 spec/unit/converters/array/array_to_set_spec.rb
necromancer-0.5.0 spec/unit/converters/array/array_to_set_spec.rb