Skip to content

Commit

Permalink
rename to removeCounter
Browse files Browse the repository at this point in the history
  • Loading branch information
Robey Pointer committed Sep 20, 2011
1 parent acd7257 commit fd867cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ class StatsCollection extends StatsProvider with JsonSerializable {
counter
}

def clearCounter(name: String) = {
counterMap.remove(name);
def removeCounter(name: String) {
counterMap.remove(name)
}

protected def newCounter(name: String) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ object StatsCollectionSpec extends Specification {
collection.incr("widgets", -1)
collection.getCounters() mustEqual Map("widgets" -> 2)
}

"clearCounter" in {
collection.getCounter("smellyfeet")
collection.incr("smellyfeet", 1)
collection.getCounters() mustEqual Map("smellyfeet" -> 1)
collection.clearCounter("smellyfeet")
collection.getCounters() mustEqual Map()
collection.getCounter("smellyfeet")
collection.incr("smellyfeet", 1)
collection.getCounters() mustEqual Map("smellyfeet" -> 1)
collection.removeCounter("smellyfeet")
collection.getCounters() mustEqual Map()
}
}

Expand Down

0 comments on commit fd867cb

Please sign in to comment.