test/capistrano_test.rb in airbrake-3.1.12 vs test/capistrano_test.rb in airbrake-3.1.13
- old
+ new
@@ -1,15 +1,19 @@
require File.expand_path '../helper', __FILE__
-require 'capistrano/configuration'
+silence_warnings { require 'capistrano/configuration' }
require 'airbrake/capistrano'
class CapistranoTest < Test::Unit::TestCase
def setup
super
reset_config
+ # Save value to avoid polluting ENV for future tests
+ @old_user = ENV['USER']
+ ENV['USER'] = %q[D'Angelo "D" Barksdale]
+
@configuration = Capistrano::Configuration.new
Airbrake::Capistrano.load_into(@configuration)
@configuration.dry_run = true
end
@@ -28,7 +32,11 @@
@configuration.logger = logger
@configuration.find_and_execute_task('airbrake:deploy')
assert io.string.include?('** Notifying Airbrake of Deploy')
assert io.string.include?('** Airbrake Notification Complete')
+ assert io.string.include?(%q[D\'Angelo\ \"D\"\ Barksdale])
end
+
+ # Return ENV['USER'] to its original value
+ def teardown; ENV['USER'] = @old_user end
end