Permalink
Browse files

Implement pending specs

  • Loading branch information...
1 parent 375cb53 commit 8ebb1ef7607ddb83b4c8632e8f18976b85e50b81 @ttencate committed Jan 15, 2012
Showing with 16 additions and 8 deletions.
  1. +2 −2 environments/development.rb
  2. +1 −1 lib/blimp.rb
  3. +6 −2 spec/blimp/site_spec.rb
  4. +1 −1 spec/blimp/web_server_spec.rb
  5. +6 −2 spec/blimp_spec.rb
@@ -1,4 +1,4 @@
-sample_root = Blimp.root.join("sample")
+sample_root = Blimp.gem_root.join("sample")
sample_source = Blimp::Sources::DiskSource.new(sample_root)
sample_site = Site.new("sample", sample_source, domains: ["localhost", "127.0.0.1"])
-Sites.add(sample_site)
+Sites.add(sample_site)
View
@@ -32,7 +32,7 @@
MIME::Types.add(markdown)
module Blimp
- def self.root
+ def self.gem_root
Pathname.new(File.dirname(__FILE__)).join("..")
end
end
@@ -10,7 +10,9 @@
describe "config" do
it "should read the config if file exists" do
- pending "TODO: stub the source and check that the config is being read"
+ source = stub
+ source.should_receive(:get_file).with("/_blimp.yaml").and_return(SourceFile.new("/_blimp.yaml", ""))
+ Site.new("my-site", source)
end
it "should raise if the config file is invalid" do
@@ -21,7 +23,9 @@
end
it "should work if the config file does not exist" do
- pending "TODO: stub the source and check that it attempts to read the config"
+ source = stub
+ source.should_receive(:get_file).with("/_blimp.yaml").and_raise(SourceFile::NotFound)
+ Site.new("my-site", source)
end
end
@@ -10,7 +10,7 @@ def app
end
before do
- sample_root = Blimp.root.join("sample")
+ sample_root = Blimp.gem_root.join("sample")
sample_source = Blimp::Sources::DiskSource.new(sample_root)
sample_site = Site.new("sample", sample_source, domains: ["example.org"])
Sites.add(sample_site)
View
@@ -1,7 +1,11 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Blimp" do
- describe '#root' do
- it 'should be the root'
+ describe '#gem_root' do
+ it 'should be the root of the project' do
+ gem_root = Blimp.gem_root
+ File.exists?(File.join(gem_root, "lib/blimp.rb")).should be_true
+ File.exists?(File.join(gem_root, "bin/blimp")).should be_true
+ end
end
end

0 comments on commit 8ebb1ef

Please sign in to comment.