Skip to content

Commit

Permalink
Remove ActiveSupport dep
Browse files Browse the repository at this point in the history
  • Loading branch information
jstorimer committed Jul 27, 2011
1 parent 70b90d5 commit cd34f4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/stats_d.rb
@@ -1,7 +1,9 @@
require 'socket'

module StatsD
mattr_accessor :host, :port, :mode, :logger, :enabled
class << self
attr_accessor :host, :port, :mode, :logger, :enabled
end
self.enabled = true

trap("TTOU") { self.enabled = false }
Expand Down
5 changes: 2 additions & 3 deletions test/stats_d_test.rb
@@ -1,8 +1,7 @@
require 'active_support/all'
$LOAD_PATH << File.dirname(__FILE__) + '/../lib'
require 'stats_d'
require 'test/unit'
require 'mocha'
require 'logger'

StatsD.logger = Logger.new('/dev/null')

Expand Down Expand Up @@ -110,7 +109,7 @@ def test_count_with_successful_sample
StatsD.unstub(:increment)
StatsD.stubs(:rand).returns(0.01)
StatsD.logger.expects(:info).once.with do |string|
string.ends_with?('@0.1')
string.include?('@0.1')
end

StatsD.increment('sampling.foo.bar', 1, 0.1)
Expand Down

0 comments on commit cd34f4b

Please sign in to comment.