Sha256: d2bf5a83c9a95efdd9239046fc66f5f86f07318434dd5b40ba40af6ce340382f

Contents?: true

Size: 1.59 KB

Versions: 27

Compression:

Stored size: 1.59 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

module PhusionPassenger

shared_examples_for "a Rails spawner that supports #reload(app_group_name)" do
	it "#reload(app_group_name) reloads a specific application" do
		use_some_stub do |stub1|
		use_some_stub do |stub2|
			File.append(stub1.startup_file, %q{
				File.write("output.txt", "stub 1, variant #{ENV['VARIANT']}")
			})
			File.append(stub2.startup_file, %q{
				File.write("output.txt", "stub 2")
			})
			
			spawn_stub_application(stub1,
				"app_group_name" => "stub 1, variant A",
				"environment_variables" => ["VARIANT\0A\0"].pack('m')
			).close
			spawn_stub_application(stub1,
				"app_group_name" => "stub 1, variant B",
				"environment_variables" => ["VARIANT\0B\0"].pack('m')
			).close
			spawn_stub_application(stub2).close
			
			spawner.reload("stub 1, variant A")
			
			File.append(stub1.startup_file, %q{
				File.write("output.txt", "stub 1 modified, variant #{ENV['VARIANT']}")
			})
			File.append(stub2.startup_file, %q{
				File.write("output.txt", "stub 2 modified")
			})
			
			spawn_stub_application(stub1,
				"app_group_name" => "stub 1, variant A",
				"environment_variables" => ["VARIANT\0A\0"].pack('m')
			).close
			spawn_stub_application(stub1,
				"app_group_name" => "stub 1, variant B",
				"environment_variables" => ["VARIANT\0B\0"].pack('m')
			).close
			spawn_stub_application(stub2).close
			
			File.read("#{stub1.app_root}/output.txt").should == "stub 1 modified, variant A"
			File.read("#{stub2.app_root}/output.txt").should == "stub 2"
		end
		end
	end
end

end # module PhusionPassenger

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
passenger-3.0.21 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.19 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.18 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.17 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.15 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.14 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.13 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.12 test/ruby/shared/spawners/reload_single_spec.rb
yspassenger-3.0.12 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.11 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.10 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.9 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.8 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.7 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.6 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.5 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.4 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.3 test/ruby/shared/spawners/reload_single_spec.rb
railsware-passenger-3.0.2.1 test/ruby/shared/spawners/reload_single_spec.rb
passenger-3.0.2 test/ruby/shared/spawners/reload_single_spec.rb