<NME> warn_spec.rb
<BEF> ADDFILE
<MSG> Add shell status display calls and change say to use new statement.

<DFF> @@ -0,0 +1,28 @@
+# -*- encoding: utf-8 -*-
+
+require 'spec_helper'
+
+describe TTY::Shell, '#warn' do
+  let(:input)  { StringIO.new }
+  let(:output) { StringIO.new }
+
+  subject(:shell) { TTY::Shell.new(input, output) }
+
+  after { output.rewind }
+
+  it 'displays one message' do
+    shell.warn "Careful young apprentice!"
+    expect(output.string).to eql "\e[33mCareful young apprentice!\e[0m\n"
+  end
+
+  it 'displays many messages' do
+    shell.warn "Careful there!", "It's dangerous!"
+    expect(output.string).to eql "\e[33mCareful there!\e[0m\n\e[33mIt's dangerous!\e[0m\n"
+  end
+
+  it 'displays message with option' do
+    shell.warn "Careful young apprentice!", :newline => false
+    expect(output.string).to eql "\e[33mCareful young apprentice!\e[0m"
+  end
+
+end # warn

{'addition_count': 28, 'commit_subject': 'Add shell status display calls and change say to use new statement.', 'deletion_count': 0, 'file_extension': '.rb', 'lang': 'rb', 'license': 'mit', 'repo_name': 'piotrmurach/tty'}