Sha256: a2bd07158f3afffe6c9443a7555ca7703b0fb7e2522f2a7ae3b85720460597c4

Contents?: true

Size: 1.06 KB

Versions: 27

Compression:

Stored size: 1.06 KB

Contents

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

module PhusionPassenger

shared_examples_for "a ClassicRails::FrameworkSpawner" do
	it "raises FrameworkInitError if the framework could not be loaded" do
		block = lambda do
			load_nonexistant_framework("print_framework_loading_exceptions" => false).close
		end
		block.should raise_error(FrameworkInitError)
	end
	
	it "prints the exception to STDERR if the framework could not be loaded" do
		old_stderr = STDERR
		file = File.new('output.tmp', 'w+')
		begin
			Object.send(:remove_const, "STDERR") rescue nil
			Object.const_set("STDERR", file)
			
			block = lambda do
				load_nonexistant_framework.close
			end
			block.should raise_error(FrameworkInitError)
			
			file.rewind
			data = file.read
			data.should =~ /load_nonexistant_framework/
			data.should =~ /framework_spawner_spec\.rb/
		ensure
			Object.send(:remove_const, "STDERR") rescue nil
			Object.const_set("STDERR", old_stderr)
			file.close rescue nil
			File.unlink('output.tmp') rescue nil
		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/classic_rails/framework_spawner_spec.rb
passenger-3.0.19 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.18 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.17 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.15 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.14 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.13 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.12 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
yspassenger-3.0.12 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.11 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.10 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.9 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.8 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.7 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.6 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.5 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.4 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.3 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
railsware-passenger-3.0.2.1 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb
passenger-3.0.2 test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb