Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some specs for the Halcyon base class functionality and impleme…
…nted configurable load paths. [#33 state:resolved]
- Loading branch information
Showing
9 changed files
with
82 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
describe "Halcyon" do | ||
|
||
before do | ||
@log = '' | ||
@logger = Logger.new(StringIO.new(@log)) | ||
@config = $config.dup | ||
@config[:logger] = @logger | ||
@config[:app] = 'Specs' | ||
Halcyon.config = @config | ||
@app = Halcyon::Runner.new | ||
end | ||
|
||
it "should provide the path of the application root directory" do | ||
Halcyon.root.should == Dir.pwd | ||
end | ||
|
||
it "should provide quick access to the configuration hash" do | ||
Halcyon.config.is_a?(Hash).should.be.true? | ||
end | ||
|
||
it "should provide universal access to a logger" do | ||
# We assume Logger here because, you know, we're gods of the test | ||
Halcyon.logger.is_a?(Logger).should.be.true? | ||
# And this is just a side affect of making the logger universally accessible | ||
{}.logger.is_a?(Logger).should.be.true? | ||
end | ||
|
||
it "should provide the (estimated) application name" do | ||
# We set this above | ||
Halcyon.app.should == "Specs" | ||
end | ||
|
||
it "should provide sane default paths for essential components" do | ||
Halcyon.paths.is_a?(Hash).should.be.true? | ||
Halcyon.paths[:controller].should == Halcyon.root/"app" | ||
Halcyon.paths[:lib].should == Halcyon.root/"lib" | ||
Halcyon.paths[:config].should == Halcyon.root/"config" | ||
Halcyon.paths[:init].should == Halcyon.root/"config"/"{init,initialize}" | ||
Halcyon.paths[:log].should == Halcyon.root/"log" | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.