Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Output Helpers' do | ||
before :each do | ||
@out = Object.new | ||
@out.send :extend, Mina::OutputHelpers | ||
|
||
allow(@out).to receive(:print_stdout) | ||
allow(@out).to receive(:print_status) | ||
allow(@out).to receive(:print_error) | ||
allow(@out).to receive(:print_command) | ||
allow(@out).to receive(:print_clear) | ||
end | ||
|
||
it 'print_str to stdout' do | ||
@out.print_str "Hello there\n" | ||
|
||
expect(@out).to have_received(:print_stdout).with("Hello there\n") | ||
end | ||
|
||
it 'print_str to status' do | ||
@out.print_str "-----> Getting password" | ||
|
||
expect(@out).to have_received(:print_status).with("Getting password") | ||
end | ||
|
||
it 'print_str to status (2)' do | ||
@out.print_str "-> Getting password" | ||
|
||
expect(@out).to have_received(:print_status).with("Getting password") | ||
end | ||
|
||
it 'print_str to error' do | ||
@out.print_str "! Something went wrong" | ||
|
||
expect(@out).to have_received(:print_error).with("Something went wrong") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters