File: new_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 (20 lines) | stat: -rw-r--r-- 511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

RSpec.describe TTY::Prompt, "#new" do
  let(:env) { {"TTY_TEST" => true} }

  it "sets prefix" do
    prompt = described_class.new(prefix: "[?]", env: env)
    expect(prompt.prefix).to eq("[?]")
  end

  it "sets input stream" do
    prompt = described_class.new(input: :stream1, env: env)
    expect(prompt.input).to eq(:stream1)
  end

  it "sets output stream" do
    prompt = described_class.new(output: :stream2, env: env)
    expect(prompt.output).to eq(:stream2)
  end
end