Sha256: bcc6dcd4ff5fbdd7d9d5c82c8a5e8b452c2778ca26ed48b508ca428d795b5b40

Contents?: true

Size: 747 Bytes

Versions: 22

Compression:

Stored size: 747 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "The Logger" do
  before(:each) do
    @stdout_orig  = $stdout
    $stdout       = StringIO.new

    @stderr_orig  = $stderr
    $stderr       = StringIO.new
  end

  context "Reporting an error" do
    it "should output a formatted message with a red color" do
      Pullentity::Client::Logger.error("This is failing.")
      $stderr.string.should == "\e[1m\e[31mThis is failing.\e[0m\e[0m\n"
    end
  end

  context "Reporting back a success" do
    it "should output a formatted message with a green color" do
      Pullentity::Client::Logger.report("This is a success.")
      $stdout.string.should == "\e[1m\e[32mThis is a success.\e[0m\e[0m\n"
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pullentity-client-0.3.9 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.8 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.7 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.6 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.5 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.4 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.3 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.2 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.1 spec/pullentity-client/logger_spec.rb
pullentity-client-0.3.0 spec/pullentity-client/logger_spec.rb
pullentity-client-0.1.3 spec/pullentity-client/logger_spec.rb
pullentity-client-0.1.2 spec/pullentity-client/logger_spec.rb
pullentity-client-0.1.1 spec/pullentity-client/logger_spec.rb
pullentity-client-0.1.0 spec/pullentity-client/logger_spec.rb
pullentity-client-0.0.9 spec/pullentity-client/logger_spec.rb
pullentity-client-0.0.8 spec/pullentity-client/logger_spec.rb
pullentity-client-0.0.7 spec/pullentity-client/logger_spec.rb
pullentity-client-0.0.6 spec/pullentity-client/logger_spec.rb
pullentity-client-0.0.4 spec/pullentity-client/logger_spec.rb
pullentity-client-0.0.3 spec/pullentity-client/logger_spec.rb