File: add_spec.rb

package info (click to toggle)
ruby-tty-prompt 0.23.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,452 kB
  • sloc: ruby: 8,847; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true

RSpec.describe TTY::Prompt::Choices, "#<<" do
  it "adds choice to collection" do
    choices = described_class.new
    expect(choices).to be_empty
    choice = TTY::Prompt::Choice.from([:label, 1])
    choices << [:label, 1]
    expect(choices.size).to eq(1)
    expect(choices.to_ary).to eq([choice])
  end
end