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 !
Hongli Lai (Phusion) (author)
Thu May 01 12:13:06 -0700 2008
commit  53301de464b323d364723854d3a8d293ab8327d6
tree    23e53e1e40d0fea9ecd6312dca292b3e7f2f5cb8
parent  3f5fb12ba8240018c6210a42d2550d21a3cd6497
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