Skip to content

Commit

Permalink
Fixed DslError bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Gleb Pomykalov committed Oct 3, 2011
1 parent af56e7e commit ea848ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/daemonizer/dsl.rb
@@ -1,6 +1,6 @@
class Daemonizer::DslError < StandardError; end

class Daemonizer::Dsl
class DslError < StandardError; end

def self.evaluate(daemonfile, daemonfile_name = 'Daemonfile')
builder = new
builder.instance_eval(daemonfile, daemonfile_name.to_s, 1)
Expand Down
10 changes: 10 additions & 0 deletions spec/settings/options_spec.rb
Expand Up @@ -34,6 +34,16 @@ class OptionsSpecHandler < SpecHandler; end
@eval.configs[:test][:handler_options].should be_kind_of(Hash)
@eval.configs[:test][:handler_options].size.should == 3
end

it "should raise DslError if nothing provided to set_option" do
lambda {
Daemonizer::Dsl.evaluate(<<-G)
pool :test do
set_option :option1, nil
end
G
}.should raise_error Daemonizer::Dsl::DslError
end
end

describe "pool options in Daemonizer::Config" do
Expand Down

0 comments on commit ea848ae

Please sign in to comment.