spec/generator_spec.rb in zero_push-2.4.0 vs spec/generator_spec.rb in zero_push-2.4.1
- old
+ new
@@ -6,10 +6,11 @@
destination File.expand_path('../tmp', __FILE__)
tests ZeroPush::InstallGenerator
test 'it copies the initializer' do
production_token = 'production'
development_token = 'development'
- $stdin.stubs(:gets).returns(production_token).then.returns(development_token)
+ ZeroPush::InstallGenerator.any_instance.stubs(:ask).returns(production_token).then.returns(development_token)
+
run_generator
assert_file 'config/initializers/zero_push.rb' do |initializer|
production_config = %Q|ZeroPush.auth_token = '#{production_token}'|
assert(initializer.include?(production_config), "The initializer doesn't include the production configuration")