Skip to content

Commit

Permalink
XAP not generated in production [#29 status:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
jschementi committed Jul 3, 2008
1 parent bbb5523 commit fc64303
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions vendor/plugins/silverline/lib/silverline/essential.rb
Expand Up @@ -17,8 +17,10 @@ module Silverline::Essential

end

require 'silverline/essential/generator'
Silverline::Essential::Generator.register
if ENV['RAILS_ENV'] != 'production'
require 'silverline/essential/generator'
Silverline::Essential::Generator.register
end

require 'silverline/essential/html'
ActionView::Base.class_eval do
Expand Down
Expand Up @@ -32,11 +32,19 @@ class Base
ActionView::Base.included_modules.include?(Silverline::Essential::Html)
end

it "should tell the generator to register itself" do
it "should tell the generator to register itself in development mode" do
ENV.stub!(:[]).with('RAILS_ENV').and_return('development')
Silverline::Essential.instance_eval{remove_const :Generator} if defined?(Silverline::Essential::Generator)
gen = Silverline::Essential::Generator = mock("Generator")
gen.should_receive(:register)
load 'silverline/essential.rb'
end

it "should not tell the generator to register itself in production mode" do
ENV.stub!(:[]).with('RAILS_ENV').and_return('production')
Silverline::Essential.instance_eval{remove_const :Generator} if defined?(Silverline::Essential::Generator)
gen = Silverline::Essential::Generator = mock("Generator")
gen.should_not_receive(:register)
load 'silverline/essential.rb'
end
end

0 comments on commit fc64303

Please sign in to comment.