Sha256: bf8f358b651971fec9d5aacaf59b43b0b1489cd7b8ae7557000259e1fd35ff68

Contents?: true

Size: 688 Bytes

Versions: 8

Compression:

Stored size: 688 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "..", "example_helper.rb")

describe 'Relevance::Tarantula::LogGrabber' do
  before do
    @grabber = Relevance::Tarantula::LogGrabber.new(log_file)
    FileUtils.mkdir_p(test_output_dir)
  end

  def log_file
    File.join(File.join(test_output_dir, "example.log"))
  end

  it "can clear the log file" do
    File.open(log_file, "w") {|f| f.print "sample log"}
    File.size(log_file).should == 10
    @grabber.clear!
    File.size(log_file).should == 0
  end

  it "can grab the log file" do
    File.open(log_file, "w") {|f| f.print "sample log"}
    @grabber.grab!.should == "sample log"
    File.size(log_file).should == 0
  end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
relevance-tarantula-0.1.0 examples/relevance/tarantula/log_grabber_example.rb
relevance-tarantula-0.1.1 examples/relevance/tarantula/log_grabber_example.rb
relevance-tarantula-0.1.2 examples/relevance/tarantula/log_grabber_example.rb
relevance-tarantula-0.1.3 examples/relevance/tarantula/log_grabber_example.rb
relevance-tarantula-0.1.4 examples/relevance/tarantula/log_grabber_example.rb
relevance-tarantula-0.1.5 examples/relevance/tarantula/log_grabber_example.rb
tarantula-0.1.4 examples/relevance/tarantula/log_grabber_example.rb
tarantula-0.1.5 examples/relevance/tarantula/log_grabber_example.rb