File: enabled_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 (11 lines) | stat: -rw-r--r-- 391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

RSpec.describe TTY::Prompt::Choices, "#enabled" do
  it "returns only choices which aren't disabled" do
    enabled_choice = TTY::Prompt::Choice.new :foo, :bar
    disabled_choice = TTY::Prompt::Choice.new :fizz, :bazz, disabled: true

    choices = described_class[enabled_choice, disabled_choice]
    expect(choices.enabled).to eq [enabled_choice]
  end
end