Sha256: 126b097b179057e5bb0b0b8de0c0b7ec883322634e8b3a5ac50a280327b3a80c

Contents?: true

Size: 920 Bytes

Versions: 3

Compression:

Stored size: 920 Bytes

Contents

require 'spec_helper'
require 'tempfile'

describe Woodchuck::Watcher do
  describe '#initialize' do
    let(:logfile) { Tempfile.new("foobar") }

    subject { described_class.new(logfile) }
    
    it 'sets a logger' do
      subject.logger.should be_a Woodchuck::Logger
    end
    it 'sets a tailer' do
      subject.tailer.should be_a FileWatch::Tail
    end
    it 'sets the watched paths' do
      subject.paths.should == [logfile]
    end
  end

  # describe '#run' do
  #   let(:logfile) { Tempfile.new("foobar") }
  #   let(:path) { fixture_path }
  #   let(:timestamp) { Time.now.utc.iso8601(6) }
  #   subject { described_class.new(logfile) }
  #   
  #   before do
  #     Socket.stub(:gethostname).and_return("example.com")
  #     # subject.run
  #     # logfile.write("a message!\n")
  #     # logfile.flush
  #   end
  # 
  #   # it do
  #   #   subject.events.size.should == 1
  #   # end
  # end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
woodchuck-json-event-0.0.2 spec/woodchuck/watcher_spec.rb
woodchuck-json-event-0.0.1 spec/woodchuck/watcher_spec.rb
woodchuck-0.0.1 spec/woodchuck/watcher_spec.rb