Sha256: 894bb82f238c35a5463ae16f0f285a63790c33ad74c6beef6864ba76e91d9756

Contents?: true

Size: 1.31 KB

Versions: 41

Compression:

Stored size: 1.31 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'ruby/shared/loader_sharedspec'
require 'ruby/shared/ruby_loader_sharedspec'
require 'ruby/shared/rails/analytics_logging_extensions_sharedspec'

module PhusionPassenger

describe "Classic Rails 2.3 loader" do
	include LoaderSpecHelper

	before :each do
		@stub = register_stub(ClassicRailsStub.new("rails2.3"))
	end

	def start(options = {})
		@loader = Loader.new(["ruby", "#{PhusionPassenger.helper_scripts_dir}/classic-rails-loader.rb"], @stub.app_root)
		return @loader.start(options)
	end

	def rails_version
		return "2.3"
	end

	it_should_behave_like "a loader"
	it_should_behave_like "a Ruby loader"

	it "calls the starting_worker_process event with forked=false" do
		File.prepend(@stub.environment_rb, %q{
			history_file = "history.txt"
			PhusionPassenger.on_event(:starting_worker_process) do |forked|
				::File.open(history_file, 'a') do |f|
					f.puts "worker_process_started: forked=#{forked}\n"
				end
			end
			::File.open(history_file, 'a') do |f|
				f.puts "end of startup file\n"
			end
		})
		result = start
		result[:status].should == "Ready"
		File.read("#{@stub.app_root}/history.txt").should ==
			"end of startup file\n" +
			"worker_process_started: forked=false\n"
	end
end if TEST_CLASSIC_RAILS

end # module PhusionPassenger

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
passenger-4.0.45 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.44 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.43 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.42 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.41 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.40 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.39 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.38 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.37 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.36 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.35 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.34 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.33 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.32 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.31 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.30 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.29 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.28 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.27 test/ruby/classic_rails/loader_spec.rb
passenger-4.0.26 test/ruby/classic_rails/loader_spec.rb