Sha256: 0646cfc145d807c856f32dc5f9ba746b2c97c2ee9e0d78b4543e4ee1a9694ccf

Contents?: true

Size: 701 Bytes

Versions: 6

Compression:

Stored size: 701 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'fedux_org_stdlib/core_ext/hash/list'

RSpec.describe Array do
  context '#to_list' do
    it 'converts array to a list of values' do
      input = {
        opt1: 'asdf',
        opt2: 'asdf'
      }

      expect(input.to_list).to eq '"opt1: asdf", "opt2: asdf"'
    end

    it 'passes options' do
      input = {
        opt1: 'asdf',
        opt2: 'asdf'
      }

      expect(input.to_list(around: "'")).to eq %('opt1: asdf', 'opt2: asdf')
    end

    it 'changes format' do
      input = {
        opt1: 'asdf',
        opt2: 'asdf'
      }

      expect(input.to_list(format: '%s | %s')).to eq %("opt1 | asdf", "opt2 | asdf")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.11.18 spec/core_ext/hash/list_spec.rb
fedux_org-stdlib-0.11.17 spec/core_ext/hash/list_spec.rb
fedux_org-stdlib-0.11.16 spec/core_ext/hash/list_spec.rb
fedux_org-stdlib-0.11.15 spec/core_ext/hash/list_spec.rb
fedux_org-stdlib-0.11.14 spec/core_ext/hash/list_spec.rb
fedux_org-stdlib-0.11.12 spec/core_ext/hash/list_spec.rb