Permalink
Browse files

Merge pull request #77 from sleeper/rake_test_fix

Rake test fix
  • Loading branch information...
2 parents a91b4f7 + 0827884 commit 1bdfbe0cce4def0e6ad27a3da2550bcbf7ee7f87 @dj2 dj2 committed Aug 9, 2011
Showing with 19 additions and 0 deletions.
  1. +2 −0 spec/integration/template_spec.rb
  2. +13 −0 spec/unit/runner_spec.rb
  3. +4 −0 spec/unit/server_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'
require File.join(File.dirname(__FILE__), '../../', 'examples/template')
+
describe Template do
def config_file
@@ -10,6 +11,7 @@ def config_file
let(:api_options) { { :config => config_file } }
it 'renders haml template with default haml layout' do
+
with_api(Template, api_options) do
get_request do |c|
c.response.should =~ %r{<li><a href="/joke">Tell me a joke</a></li>}
View
@@ -10,6 +10,13 @@
@r.stub!(:setup_logger).and_return(@log_mock)
end
+ after(:each) do
+ # Runner default env is development.
+ # We do need to revert to test
+ Goliath.env = :test
+ end
+
+
describe 'server execution' do
describe 'daemonization' do
it 'daemonizes if specified' do
@@ -30,6 +37,12 @@
@r = Goliath::Runner.new([], nil)
end
+ after(:each) do
+ # Runner default env is development.
+ # We do need to revert to test
+ Goliath.env = :test
+ end
+
describe 'without setting up file logger' do
before(:each) do
@r.stub!(:setup_file_logger)
View
@@ -105,6 +105,10 @@
context 'config parsing' do
context 'environment' do
+ after(:all) do
+ # Be sure to revert to correct env
+ Goliath.env = :test
+ end
it 'executes the block if the environment matches the provided string' do
Goliath.env = :development
block_run = false

0 comments on commit 1bdfbe0

Please sign in to comment.