Sha256: eff4f20c3385a53063aa4eabbcdaac34be258d96a7bbfdbbc9a316aacd79ebc7

Contents?: true

Size: 831 Bytes

Versions: 15

Compression:

Stored size: 831 Bytes

Contents

require 'sitehub/middleware/logging/log_entry'
class SiteHub
  module Middleware
    module Logging
      describe LogEntry do
        describe '#initialize' do
          let(:time) { Time.now }
          subject do
            described_class.new(:message, time)
          end

          it 'sets the message' do
            expect(subject.message).to be(:message)
          end

          it 'sets the time' do
            expect(subject.time).to be(time)
          end

          context 'time not supplied' do
            subject do
              described_class.new(:message)
            end
            it 'defaults the time' do
              expect(Time).to receive(:now).and_return(:current_time)
              expect(subject.time).to be(:current_time)
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sitehub-0.5.0.alpha12 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.4.10 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha11 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha10 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha8 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha7 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha6 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha5 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha4 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha3 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.5.0.alpha2 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.4.9 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.4.8 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.4.7 spec/sitehub/middleware/logging/log_entry_spec.rb
sitehub-0.4.6 spec/sitehub/middleware/logging/log_entry_spec.rb