Sha256: 3d1679a7f56cdff19741fd77524d7ada5a4f7e2c23e87c8d0ceb7192c9ebe7fb

Contents?: true

Size: 1.26 KB

Versions: 22

Compression:

Stored size: 1.26 KB

Contents

require 'gorgon/originator_logger'

describe OriginatorLogger do
  before do
    OriginatorLogger.any_instance.stub(:initialize_logger)
  end

  let (:originator_logger) { OriginatorLogger.new "" }

  describe "#log_message" do
    it "prints start messages" do
      payload = {:action => "start",
                 :hostname => "host",
                 :filename => "filename"}
      originator_logger.should_receive(:log).with("Started running 'filename' at 'host'")
      originator_logger.log_message(payload)
    end

    it "prints finish messages" do
      payload = {:action => "finish",
                 :hostname => "host",
                 :filename => "filename"}
      originator_logger.should_receive(:log).with("Finished running 'filename' at 'host'")
      originator_logger.log_message(payload)
    end

    it "prints failure messages when a test finishes with failures" do
      payload = {:action => "finish",
                 :type => "fail",
                 :hostname => "host",
                 :filename => "filename",
                 :failures => [
                   "failure"
                 ]}

      originator_logger.should_receive(:log).with("Finished running 'filename' at 'host'failure\n")
      originator_logger.log_message(payload)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
gorgon-0.6.0 spec/originator_logger_spec.rb
gorgon-0.6.0.rc2 spec/originator_logger_spec.rb
gorgon-0.6.0.rc1 spec/originator_logger_spec.rb
gorgon-0.5.0.rc1 spec/originator_logger_spec.rb
gorgon-0.4.5 spec/originator_logger_spec.rb
gorgon-0.4.5.rc1 spec/originator_logger_spec.rb
gorgon-0.4.4 spec/originator_logger_spec.rb
gorgon-0.4.3 spec/originator_logger_spec.rb
gorgon-0.4.2 spec/originator_logger_spec.rb
gorgon-0.4.1 spec/originator_logger_spec.rb
gorgon-0.4.1.rc1 spec/originator_logger_spec.rb
gorgon-0.4.0 spec/originator_logger_spec.rb
gorgon-0.4.0.rc2 spec/originator_logger_spec.rb
gorgon-0.4.0.rc1 spec/originator_logger_spec.rb
gorgon-0.3.2 spec/originator_logger_spec.rb
gorgon-0.3.1 spec/originator_logger_spec.rb
gorgon-0.3.0 spec/originator_logger_spec.rb
gorgon-0.2.0 spec/originator_logger_spec.rb
gorgon-0.1.1 spec/originator_logger_spec.rb
gorgon-0.1.0 spec/originator_logger_spec.rb