Skip to content

Commit

Permalink
Updated the #load_file spec to not expect an exception (which had bee…
Browse files Browse the repository at this point in the history
…n changed) and now tests for warning.
  • Loading branch information
mtodd committed Apr 11, 2008
1 parent 2bba3b1 commit 917b577
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spec/halcyon/runner_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
module Kernel
alias_method :__warn, :warn
def warn(msg)
$warning = msg
__warn(msg) if $do_warns
end
end

describe "Halcyon::Runner" do

before do
Expand All @@ -9,8 +17,12 @@
@app = Halcyon::Runner.new
end

it "should raise an exception if a non-existent config file is loaded" do
should.raise(LoadError) { Halcyon::Runner.load_config(Halcyon.root/'config'/'config.yml') }
it "should warn if a non-existent config file is loaded" do
$do_warns = false
path = Halcyon.root/'config'/'config.yml'
Halcyon::Runner.load_config(path).is_a?(Hash).should == true
$warning.should =~ %r{#{path} not found}
$do_warns = true
end

it "should set up logging according to configuration" do
Expand Down

0 comments on commit 917b577

Please sign in to comment.