We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Refactor more tests.
Hongli Lai (Phusion) (author)
Tue May 06 02:21:28 -0700 2008
commit  c214a11e030f92eaaebec60a8323b3b7ffd89476
tree    9fc6a39b60883d18dca31b373ab5f9468821a9d1
parent  aa4ee869de6974a6d5499eb26d3619971af00cc8
...
1
2
 
3
4
5
...
11
12
13
14
 
15
16
17
...
1
 
2
3
4
5
...
11
12
13
 
14
15
16
17
0
@@ -1,5 +1,5 @@
0
 shared_examples_for "AbstractServer" do
0
- it "should not crash if it's started and stopped multiple times" do
0
+ it "doesn't crash if it's started and stopped multiple times" do
0
     3.times do
0
       # Give the server some time to install the
0
       # signal handlers. If we don't give it enough
0
@@ -11,7 +11,7 @@ shared_examples_for "AbstractServer" do
0
     end
0
   end
0
   
0
- it "should raise a ServerAlreadyStarted if the server is already started" do
0
+ it "raises a ServerAlreadyStarted if the server is already started" do
0
     lambda { @server.start }.should raise_error(AbstractServer::ServerAlreadyStarted)
0
   end
0
 end
...
1
 
2
3
4
5
6
7
 
 
 
 
 
 
 
 
 
 
 
 
8
9
10
11
12
 
 
 
13
14
15
16
17
 
 
 
 
 
18
19
20
21
22
23
 
 
 
 
 
 
24
25
...
1
2
3
4
5
6
 
 
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
 
22
23
24
25
26
27
 
 
28
29
30
31
32
33
34
35
 
 
 
36
37
38
39
40
41
42
43
0
@@ -1,25 +1,43 @@
0
 require 'support/config'
0
+require 'support/test_helper'
0
 require 'passenger/application'
0
 include Passenger
0
 
0
 describe Application do
0
- it "should correctly detect Rails version numbers specified in environment.rb" do
0
- rails_version = Application.detect_framework_version('stub/railsapp')
0
+ include TestHelper
0
+
0
+ before :each do
0
+ @stub = setup_rails_stub('foobar')
0
+ end
0
+
0
+ after :each do
0
+ teardown_rails_stub
0
+ end
0
+
0
+ it "correctly detects Rails version numbers specified in environment.rb" do
0
+ rails_version = Application.detect_framework_version(@stub.app_root)
0
     rails_version.should =~ /^2\.0\.(\d+)$/
0
   end
0
   
0
- it "should return :vendor if an application uses a vendored Rails" do
0
- rails_version = Application.detect_framework_version('stub/minimal-railsapp')
0
+ it "returns :vendor if an application uses a vendored Rails" do
0
+ @stub.use_vendor_rails('minimal')
0
+ rails_version = Application.detect_framework_version(@stub.app_root)
0
     rails_version.should == :vendor
0
   end
0
   
0
- it "should return nil if an application does not specify its Rails version" do
0
- rails_version = Application.detect_framework_version('stub/railsapp-without-version-spec')
0
+ it "returns nil if an application does not specify its Rails version" do
0
+ File.write(@stub.environment_rb) do |content|
0
+ content.sub(/^RAILS_GEM_VERSION = .*$/, '')
0
+ end
0
+ rails_version = Application.detect_framework_version(@stub.app_root)
0
     rails_version.should be_nil
0
   end
0
   
0
- it "should raise VersionNotFound if a nonexistant Rails version is specified" do
0
- detector = lambda { Application.detect_framework_version('stub/broken-railsapp4') }
0
- detector.should raise_error(VersionNotFound)
0
+ it "raises VersionNotFound if a nonexistant Rails version is specified" do
0
+ File.write(@stub.environment_rb) do |content|
0
+ content.sub(/^RAILS_GEM_VERSION = .*$/, "RAILS_GEM_VERSION = '1.9.1972'")
0
+ end
0
+ detector = lambda { Application.detect_framework_version(@stub.app_root) }
0
+ detector.should raise_error(::Passenger::VersionNotFound)
0
   end
0
 end

Comments

    No one has commented yet.