Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

environment_info now checks to see if Rails is around, and fixing a typo

  • Loading branch information...
commit 4161cbfffa8d6aeca931ed26252e8871c3549901 1 parent 519168a
@qrush qrush authored
Showing with 9 additions and 2 deletions.
  1. +1 −1  TESTING
  2. +2 −1  lib/hoptoad_notifier.rb
  3. +6 −0 test/notifier_test.rb
View
2  TESTING
@@ -1,6 +1,6 @@
For Maintainers:
-When developing the Hoptaod Notifier, be sure to use the integration test
+When developing the Hoptoad Notifier, be sure to use the integration test
against an existing project on staging before pushing to master.
./script/integration_test.rb <test project's api key> <staging server hostname>
View
3  lib/hoptoad_notifier.rb
@@ -118,7 +118,8 @@ def report_response_body(response)
end
def environment_info
- "[Rails: #{::Rails::VERSION::STRING}] [Ruby: #{RUBY_VERSION}] [RailsEnv: #{RAILS_ENV}]"
+ info = "[Ruby: #{RUBY_VERSION}]"
+ info << " [Rails: #{::Rails::VERSION::STRING}] [RailsEnv: #{RAILS_ENV}]" if defined?(Rails)
end
def write_verbose_log(message)
View
6 test/notifier_test.rb
@@ -2,6 +2,12 @@
class NotifierTest < ActiveSupport::TestCase
context "Sending a notice" do
+ should "not fail without rails environment" do
+ assert_nothing_raised do
+ HoptoadNotifier.environment_info
+ end
+ end
+
context "with an exception" do
setup do
@sender = HoptoadNotifier::Sender.new
Please sign in to comment.
Something went wrong with that request. Please try again.