Skip to content

Commit

Permalink
fix a data serialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggederest committed Jun 15, 2011
1 parent 9dd122e commit 7e983c0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/new_relic/data_serialization_test.rb
@@ -1,6 +1,12 @@
require File.expand_path(File.join(File.dirname(__FILE__),'..', 'test_helper'))
require 'new_relic/data_serialization'
class NewRelic::DataSerializationTest < Test::Unit::TestCase

def setup
FileUtils.rm_rf('./log/newrelic_agent_store.db')
FileUtils.rm_rf('./log/newrelic_agent_store.age')
end

def test_read_and_write_from_file_read_only
file = './log/newrelic_agent_store.db'
File.open(file, 'w') do |f|
Expand Down Expand Up @@ -86,9 +92,10 @@ def test_should_send_data_disabled

def test_should_send_data_under_limit
NewRelic::DataSerialization.expects(:max_size).returns(20)
NewRelic::DataSerialization.read_and_write_to_file do
"a" * 10
NewRelic::DataSerialization.read_and_write_to_file do | old_data |
"a" * 5
end

assert(!NewRelic::DataSerialization.should_send_data?, 'Should be under the limit')
end
end

0 comments on commit 7e983c0

Please sign in to comment.