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 !
passenger / test / application_spec.rb
100644 26 lines (21 sloc) 0.93 kb
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
require 'support/config'
require 'passenger/application'
include Passenger
 
describe Application do
  it "should correctly detect Rails version numbers specified in environment.rb" do
    rails_version = Application.detect_framework_version('stub/railsapp')
    rails_version.should =~ /^2\.0\.(\d+)$/
  end
  
  it "should return :vendor if an application uses a vendored Rails" do
    rails_version = Application.detect_framework_version('stub/minimal-railsapp')
    rails_version.should == :vendor
  end
  
  it "should return nil if an application does not specify its Rails version" do
    rails_version = Application.detect_framework_version('stub/railsapp-without-version-spec')
    rails_version.should be_nil
  end
  
  it "should raise VersionNotFound if a nonexistant Rails version is specified" do
    detector = lambda { Application.detect_framework_version('stub/broken-railsapp4') }
    detector.should raise_error(VersionNotFound)
  end
end