Sha256: 35e946058a3385aab4f0395160a73fb7428578d1ea5a15d21fae057e6fed2bed

Contents?: true

Size: 644 Bytes

Versions: 15

Compression:

Stored size: 644 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Prompt, '#warn' do

  subject(:prompt) { TTY::TestPrompt.new }

  it 'displays one message' do
    prompt.warn "Careful young apprentice!"
    expect(prompt.output.string).to eql "\e[33mCareful young apprentice!\e[0m\n"
  end

  it 'displays many messages' do
    prompt.warn "Careful there!", "It's dangerous!"
    expect(prompt.output.string).to eql "\e[33mCareful there!\e[0m\n\e[33mIt's dangerous!\e[0m\n"
  end

  it 'displays message with option' do
    prompt.warn "Careful young apprentice!", newline: false
    expect(prompt.output.string).to eql "\e[33mCareful young apprentice!\e[0m"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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