test/integration_tests/apache2_tests.rb in passenger-2.2.2 vs test/integration_tests/apache2_tests.rb in passenger-2.2.3
- old
+ new
@@ -91,10 +91,22 @@
sockets.each do |socket|
socket.close rescue nil
end
end
end
+
+ it "supports environment variable passing through mod_env" do
+ begin
+ File.open("#{@stub.app_root}/public/.htaccess", 'w') do |f|
+ f.puts 'SetEnv FOO "Foo Bar!"'
+ end
+ File.touch("#{@stub.app_root}/tmp/restart.txt")
+ get('/welcome/environment').should =~ /FOO = Foo Bar\!/
+ ensure
+ File.unlink("#{@stub.app_root}/public/.htaccess") rescue nil
+ end
+ end
end
describe ": MyCook(tm) beta running in a sub-URI" do
before :all do
@web_server_supports_chunked_transfer_encoding = true
@@ -197,11 +209,12 @@
end
end
})
end
- File.open(restart_file, 'w').close
+ now = Time.now
+ File.touch(restart_file, now - 5)
get('/bar').should == "hello world"
File.open(controller, 'w') do |f|
f.write(%Q{
class BarController < ApplicationController
@@ -210,12 +223,10 @@
end
end
})
end
- now = Time.now
- File.open(restart_file, 'w').close
- File.utime(now - 10, now - 10, restart_file)
+ File.touch(restart_file, now - 10)
get('/bar').should == "oh hai"
ensure
File.unlink(controller) rescue nil
File.unlink(restart_file) rescue nil
end