Skip to content

Commit

Permalink
added richer data accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbaglieri committed Aug 16, 2011
1 parent 2a813bc commit 6e8a36c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/event_tests.rb
Expand Up @@ -3,6 +3,11 @@

class EventTests < MiniTest::Unit::TestCase

def test_recent_events_week
events = Quake::Event.last_week
assert(events.count > 0)
end

def test_recent_events_day
events = Quake::Event.last_day
assert(events.count > 0)
Expand All @@ -13,4 +18,19 @@ def test_recent_events_hour
assert(events.count > 0)
end

def test_recent_events_week_with_magnitude_of_two
events = Quake::Event.last_week(4)
events.each { assert(events[0].magnitude > 4) }
end

def test_recent_events_day_with_magnitude_of_two
events = Quake::Event.last_day(2)
events.each { assert(events[0].magnitude > 2) }
end

def test_recent_events_hour_with_magnitude_of_two
events = Quake::Event.last_hour(1)
events.each { assert(events[0].magnitude > 1) }
end

end

0 comments on commit 6e8a36c

Please sign in to comment.