Sha256: b0c231daa6fbaa7a4c7cdf96a2530301c477fa2ef98f45ccc1241c0a2fd019ab

Contents?: true

Size: 685 Bytes

Versions: 8

Compression:

Stored size: 685 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "..", "test_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.0.5 test/relevance/tarantula/log_grabber_test.rb
relevance-tarantula-0.0.6 test/relevance/tarantula/log_grabber_test.rb
relevance-tarantula-0.0.7.1 test/relevance/tarantula/log_grabber_test.rb
relevance-tarantula-0.0.7 test/relevance/tarantula/log_grabber_test.rb
relevance-tarantula-0.0.8.0 test/relevance/tarantula/log_grabber_test.rb
relevance-tarantula-0.0.8.1 test/relevance/tarantula/log_grabber_test.rb
tarantula-0.0.8.1 test/relevance/tarantula/log_grabber_test.rb
tarantula-0.0.5 test/relevance/tarantula/log_grabber_test.rb