Module: Safubot::Test
- Defined in:
- lib/safubot/test_helper.rb
Overview
Helpful methods for testing either via RSpec or IRB.
Class Method Summary collapse
-
.clean_environment ⇒ Object
Switches to the “safubot_testing” database and clears all data.
-
.request(text) ⇒ Object
Creates a Query-sourced testing Request.
Class Method Details
.clean_environment ⇒ Object
Switches to the “safubot_testing” database and clears all data.
22 23 24 25 26 27 28 29 30 |
# File 'lib/safubot/test_helper.rb', line 22 def clean_environment MongoMapper.database = "safubot_testing" Request.destroy_all Query.destroy_all Response.destroy_all KnownUser.destroy_all Safubot::mode = :testing $bot = Safubot::Bot.new(:database => "safubot_testing") end |