test/runner_test.rb in dante-0.1.5 vs test/runner_test.rb in dante-0.2.0
- old
+ new
@@ -1,7 +1,26 @@
require File.expand_path('../test_helper', __FILE__)
describe "dante runner" do
+
+ describe "verify options fails" do
+ it "should bubble up exception" do
+ runner = Dante::Runner.new('test-process', {key1:"val2"}) {
+ raise Exception.new("should not get here!!!")
+ }
+
+ runner.verify_options_hook = lambda { |opts|
+ raise Exception.new("Look for this exception") if(opts[:key1] != "val1")
+ }
+
+ err = assert_raises(Exception) {
+ runner.execute
+ }
+
+ assert_equal(err.message, "Look for this exception")
+ end
+ end
+
describe "with no daemonize" do
before do
@process = TestingProcess.new('a')
@runner = Dante::Runner.new('test-process') { @process.run_a! }
@stdout = capture_stdout { @runner.execute }
\ No newline at end of file