Sha256: 4a3d58c17b4cce91f4d086c96dbc982c7fb76f73b7fc4ec92e214743903359eb

Contents?: true

Size: 1.43 KB

Versions: 24

Compression:

Stored size: 1.43 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",
                 :worker_id => "a_worker_id"}
      originator_logger.should_receive(:log).with("Started running 'filename' at 'host:a_worker_id'")
      originator_logger.log_message(payload)
    end

    it "prints finish messages" do
      payload = {:action => "finish",
                 :hostname => "host",
                 :filename => "filename",
                 :worker_id => "a_worker_id"}
      originator_logger.should_receive(:log).with("Finished running 'filename' at 'host:a_worker_id'")
      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",
                 :worker_id => "a_worker_id",
                 :failures => [
                   "failure"
                 ]}

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
gorgon-0.11.0 spec/originator_logger_spec.rb
gorgon-0.10.5 spec/originator_logger_spec.rb
gorgon-0.10.4 spec/originator_logger_spec.rb
gorgon-0.10.3 spec/originator_logger_spec.rb
gorgon-0.10.2 spec/originator_logger_spec.rb
gorgon-0.10.1 spec/originator_logger_spec.rb
gorgon-0.10.0 spec/originator_logger_spec.rb
gorgon-0.9.0 spec/originator_logger_spec.rb
gorgon-0.8.4 spec/originator_logger_spec.rb
gorgon-0.8.3 spec/originator_logger_spec.rb
gorgon-0.8.2 spec/originator_logger_spec.rb
gorgon-0.8.1 spec/originator_logger_spec.rb
gorgon-0.8.0 spec/originator_logger_spec.rb
gorgon-0.7.1 spec/originator_logger_spec.rb
gorgon-0.7.0 spec/originator_logger_spec.rb
gorgon-0.7.0.rc4 spec/originator_logger_spec.rb
gorgon-0.7.0.rc3 spec/originator_logger_spec.rb
gorgon-0.7.0.rc2 spec/originator_logger_spec.rb
gorgon-0.7.0.rc1 spec/originator_logger_spec.rb
gorgon-0.6.5 spec/originator_logger_spec.rb