Sha256: e60f60b753d469d5d7a47bac772b685a2e9ece058dba5e1182d5c804824739f2

Contents?: true

Size: 1.1 KB

Versions: 16

Compression:

Stored size: 1.1 KB

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'
require 'smallcage'

describe SmallCage::DocumentPath do
  root = Pathname.new(File.dirname(__FILE__) + "/data/htdocs1")
  
  before do
    @docpath = SmallCage::DocumentPath.new(root, root + "a/b/c/index.html.smc")
  end
  
  it "should have uri property" do
    @docpath.uri.should == "/a/b/c/index.html.smc"
  end
  
  it "should return smc file or not" do
    @docpath.smc?.should be_true
  end
  
  it "should return output file" do
    out = @docpath.outfile
    out.should be_an_instance_of(SmallCage::DocumentPath)
    out.path.basename.to_s.should == "index.html"
    out.path.to_s.should match(%r{^/.+/a/b/c/index.html$})
    @docpath.path.to_s[0..-5].should == out.path.to_s
  end
  
  it "should return output file uri" do
    out = @docpath.outuri
    out.should == "/a/b/c/index.html"
  end
  
  it "should return root uri" do
    docpath = SmallCage::DocumentPath.new(root, root)
    docpath.uri.should == "/"
  end
  
  it "should return directory uri" do
    docpath = SmallCage::DocumentPath.new(root, root + "a/b")
    docpath.uri.should == "/a/b"
  end
  
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
bluemark-smallcage-0.1.3 spec/document_path_spec.rb
bluemark-smallcage-0.1.4 spec/document_path_spec.rb
bluemark-smallcage-0.1.5 spec/document_path_spec.rb
smallcage-0.2.1 spec/document_path_spec.rb
smallcage-0.2.0 spec/document_path_spec.rb
smallcage-0.1.9 spec/document_path_spec.rb
smallcage-0.1.8 spec/document_path_spec.rb
smallcage-0.1.7 spec/document_path_spec.rb
smallcage-0.1.6 spec/document_path_spec.rb
smallcage-0.1.5 spec/document_path_spec.rb
smallcage-0.1.4 spec/document_path_spec.rb
smallcage-0.1.3 spec/document_path_spec.rb
smallcage-0.1.2 spec/document_path_spec.rb
smallcage-0.1.1 spec/document_path_spec.rb
smallcage-0.1.0 spec/document_path_spec.rb
smallcage-0.0.9 spec/document_path_spec.rb