Skip to content

Commit

Permalink
Add rails generator to stop test server.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Apr 11, 2013
1 parent 7bb742e commit 7c36ed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rails/generators/ripple/test/test_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def create_rspec_file
end
inject_into_file 'spec/spec_helper.rb', :after => rspec_prelude do
"\n#{indentation} config.before(:suite) { Ripple::TestServer.setup }" +
"\n#{indentation} config.after(:each) { Ripple::TestServer.clear }\n"
"\n#{indentation} config.after(:each) { Ripple::TestServer.clear }" +
"\n#{indentation} config.after(:suite) { Ripple::TestServer.instance.stop }\n"
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/generators/ripple/test_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
it "should insert the test server setup" do
contents.should include(" config.before(:suite) { Ripple::TestServer.setup }")
contents.should include(" config.after(:each) { Ripple::TestServer.clear }")
contents.should include(" config.after(:suite) { Ripple::TestServer.instance.stop }")
end

context "when the configuration block is indented" do
Expand All @@ -59,6 +60,7 @@
it "should insert the test server setup with additional indentation" do
contents.should include(" config.before(:suite) { Ripple::TestServer.setup }")
contents.should include(" config.after(:each) { Ripple::TestServer.clear }")
contents.should include(" config.after(:suite) { Ripple::TestServer.instance.stop }")
end
end
end
Expand Down

0 comments on commit 7c36ed9

Please sign in to comment.