Sha256: ddc5e1c62bf53ec0d0b88347b51a3cfa7debcdd348bca44bb4a01c49bf5a31b0
Contents?: true
Size: 874 Bytes
Versions: 10
Compression:
Stored size: 874 Bytes
Contents
# encoding: utf-8 RSpec.describe TTY::Prompt::Choice, '#from' do it "skips Choice instance" do choice = described_class.new(:large, 1) expect(described_class.from(choice)).to eq(choice) end it "creates choice from string" do choice = described_class.new('large', 'large') expect(described_class.from('large')).to eq(choice) end it "creates choice from array" do choice = described_class.new('large', 1) expect(described_class.from([:large, 1])).to eq(choice) end it "creates choice from hash value" do choice = described_class.new('large', 1) expect(described_class.from({large: 1})).to eq(choice) end it "create choice from hash with key property" do default = {key: 'h', name: 'Help', value: :help} choice = described_class.new('Help', :help) expect(described_class.from(default)).to eq(choice) end end
Version data entries
10 entries across 10 versions & 1 rubygems