Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some initial specs for routing added (not much :)
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require File.dirname(__FILE__) + '/spec_helper' | ||
|
||
describe Zoid::Application, "router" do | ||
|
||
before(:each) do | ||
setup_default_store | ||
@module = Module.new do | ||
nsurl 'http://strokedb.com/zoid/spec#routing' | ||
SomeName = StrokeDB::Meta.new | ||
end | ||
@app = Zoid::Application.create!(:name => 'Routing Application', :nsurl => @module.nsurl) | ||
end | ||
|
||
it "should route GET + /name(/)? to a named entity within application module" do | ||
@app.route_for('GET', '/some_name').should == @module.const_get('SomeName') | ||
@app.route_for('GET', '/some_name/').should == @module.const_get('SomeName') | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--colour | ||
--format | ||
progress | ||
--loadby | ||
mtime | ||
--reverse | ||
--backtrace |
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,11 @@ | ||
$LOAD_PATH.unshift( File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) ).uniq! | ||
require 'zoid' | ||
|
||
SPEC_ROOT = File.expand_path(File.dirname(__FILE__)) | ||
TEMP_DIR = SPEC_ROOT + '/tmp' | ||
TEMP_STORAGES = TEMP_DIR + '/storages' | ||
|
||
def setup_default_store | ||
FileUtils.rm_rf TEMP_STORAGES + '/spec' | ||
StrokeDB::Config.build :default => true, :base_path => TEMP_STORAGES + '/spec' | ||
end |