Sha256: e9f2aef00e27763a60c4d83eb72bc2209c47ecb41cfa62ba3efcbe7690734d2f
Contents?: true
Size: 1.78 KB
Versions: 2
Compression:
Stored size: 1.78 KB
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe "Eye::Dsl" do it "fully empty config" do conf = <<-E # haha E Eye::Dsl.parse(conf).should == {:applications => {}, :config => {}} Eye::Dsl.parse_apps(conf).should == {} end it "empty config" do conf = <<-E Eye.application("bla") do end E Eye::Dsl.parse_apps(conf).should == {'bla' => {:name => "bla"}} end it "should set param " do conf = <<-E Eye.application("bla") do start_timeout 10.seconds end E Eye::Dsl.parse_apps(conf).should == {"bla"=>{:start_timeout => 10.seconds, :name => "bla"}} end it "should set param, with self and =" do conf = <<-E Eye.application("bla") do self.start_timeout = 10.seconds end E Eye::Dsl.parse_apps(conf).should == {"bla"=>{:start_timeout => 10.seconds, :name => "bla"}} end it "another block syntax" do conf = <<-E Eye.application("bla"){ start_timeout 10.seconds } E Eye::Dsl.parse_apps(conf).should == {"bla"=>{:start_timeout => 10.seconds, :name => "bla"}} end it "should raise on unknown option" do conf = <<-E Eye.application("bla") do pid_file "11" hoho 10 end E expect{Eye::Dsl.parse_apps(conf)}.to raise_error(Eye::Dsl::Error) end it "hash should not be with defaults" do conf = <<-E Eye.application("bla") do start_timeout 10.seconds process("11") do pid_file "1" end end E cfg = Eye::Dsl.parse_apps(conf) cfg[:something].should == nil cfg['bla'][:something].should == nil cfg['bla'][:groups]['__default__'][:some].should == nil cfg['bla'][:groups]['__default__'][:processes][:some].should == nil end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
eye-0.2 | spec/dsl/dsl_spec.rb |
eye-0.1.11 | spec/dsl/dsl_spec.rb |