Sha256: 5454dba55dd633635d4df9a2f8cea0b84e53f411c405810f269d163368cba93a

Contents?: true

Size: 613 Bytes

Versions: 15

Compression:

Stored size: 613 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Prompt, '.error' do
  subject(:prompt) { TTY::TestPrompt.new }

  it 'displays one message' do
    prompt.error "Nothing is fine!"
    expect(prompt.output.string).to eql "\e[31mNothing is fine!\e[0m\n"
  end

  it 'displays many messages' do
    prompt.error "Nothing is fine!", "All is broken!"
    expect(prompt.output.string).to eql "\e[31mNothing is fine!\e[0m\n\e[31mAll is broken!\e[0m\n"
  end

  it 'displays message with option' do
    prompt.error "Nothing is fine!", newline: false
    expect(prompt.output.string).to eql "\e[31mNothing is fine!\e[0m"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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