Sha256: 8e34c18b09a6bb85990f48a55ff12ef22b0c9f0ac87e7d13db1741b31af630eb

Contents?: true

Size: 294 Bytes

Versions: 13

Compression:

Stored size: 294 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Prompt::Choices, '#pluck' do
  it "plucks choice by key name" do
    collection = [{name: 'large'},{name: 'medium'},{name: 'small'}]
    choices = described_class[*collection]
    expect(choices.pluck(:name)).to eq(['large', 'medium', 'small'])
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tty-prompt-0.17.2 spec/unit/choices/pluck_spec.rb
tty-prompt-0.17.1 spec/unit/choices/pluck_spec.rb
tty-prompt-0.17.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.12.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.11.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.10.1 spec/unit/choices/pluck_spec.rb
tty-prompt-0.10.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.9.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.8.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.7.1 spec/unit/choices/pluck_spec.rb
tty-prompt-0.7.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.6.0 spec/unit/choices/pluck_spec.rb
tty-prompt-0.5.0 spec/unit/choices/pluck_spec.rb