0
@@ -11,19 +11,19 @@ describe Webby::Resources::MetaFile do
0
it 'returns the number of meta-data blocks at the top of a file' do
0
- fn = Webby.datapath %w[
content css coderay.css]
0
+ fn = Webby.datapath %w[
site content css coderay.css]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
mf.meta_count.should == 0
0
- fn = Webby.datapath %w[
content index.txt]
0
+ fn = Webby.datapath %w[
site content index.txt]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
mf.meta_count.should == 1
0
- fn = Webby.datapath %w[
content photos.txt]
0
+ fn = Webby.datapath %w[
site content photos.txt]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
mf.meta_count.should == 3
0
@@ -31,13 +31,13 @@ describe Webby::Resources::MetaFile do
0
it 'determines the end of the final meta-data block' do
0
- fn = Webby.datapath %w[
content index.txt]
0
+ fn = Webby.datapath %w[
site content index.txt]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
mf.meta_end.should == 7
0
- fn = Webby.datapath %w[
content photos.txt]
0
+ fn = Webby.datapath %w[
site content photos.txt]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
mf.meta_end.should == 18
0
@@ -47,7 +47,7 @@ describe Webby::Resources::MetaFile do
0
# -----------------------------------------------------------------------
0
it 'yields each meta-data block' do
0
- fn = Webby.datapath %w[
content photos.txt]
0
+ fn = Webby.datapath %w[
site content photos.txt]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
@@ -65,7 +65,7 @@ describe Webby::Resources::MetaFile do
0
it 'yields a single meta-data block' do
0
- fn = Webby.datapath %w[
content index.txt]
0
+ fn = Webby.datapath %w[
site content index.txt]
0
File.open(fn, 'r') do |fd|
0
mf = Webby::Resources::MetaFile.new(fd)
0
@@ -105,12 +105,12 @@ describe Webby::Resources::MetaFile do
0
# -----------------------------------------------------------------------
0
describe '#meta_data' do
0
it 'returns nil for regular files' do
0
- fn = Webby.datapath %w[
content css coderay.css]
0
+ fn = Webby.datapath %w[
site content css coderay.css]
0
Webby::Resources::MetaFile.meta_data(fn).should be_nil
0
it 'returns a hash for pages' do
0
- fn = Webby.datapath %w[
content index.txt]
0
+ fn = Webby.datapath %w[
site content index.txt]
0
h = Webby::Resources::MetaFile.meta_data(fn)
0
h.should be_instance_of(Hash)
0
@@ -118,7 +118,7 @@ describe Webby::Resources::MetaFile do
0
it 'returns a hash for layouts' do
0
- fn = Webby.datapath %w[
layouts default.txt]
0
+ fn = Webby.datapath %w[
site layouts default.txt]
0
h = Webby::Resources::MetaFile.meta_data(fn)
0
h.should be_instance_of(Hash)
0
@@ -132,12 +132,12 @@ describe Webby::Resources::MetaFile do
0
# -----------------------------------------------------------------------
0
describe "#meta_data?" do
0
it 'returns true for files with meta-data' do
0
- fn = Webby.datapath %w[
content index.txt]
0
+ fn = Webby.datapath %w[
site content index.txt]
0
Webby::Resources::MetaFile.meta_data?(fn).should == true
0
it 'returns false for files without meta-data' do
0
- fn = Webby.datapath %w[
content css coderay.css]
0
+ fn = Webby.datapath %w[
site content css coderay.css]
0
Webby::Resources::MetaFile.meta_data?(fn).should == false
0
@@ -145,12 +145,12 @@ describe Webby::Resources::MetaFile do
0
# -----------------------------------------------------------------------
0
it 'behaves the same as File#read for regular files' do
0
- fn = Webby.datapath %w[
content css coderay.css]
0
+ fn = Webby.datapath %w[
site content css coderay.css]
0
Webby::Resources::MetaFile.read(fn).should == ::File.read(fn)
0
it 'returns only the content for pages' do
0
- fn = Webby.datapath %w[
content index.txt]
0
+ fn = Webby.datapath %w[
site content index.txt]
0
lines = File.readlines(fn)
0
lines = lines[7..-1].join
0
@@ -158,7 +158,7 @@ describe Webby::Resources::MetaFile do
0
it 'returns only the content for layouts' do
0
- fn = Webby.datapath %w[
layouts default.txt]
0
+ fn = Webby.datapath %w[
site layouts default.txt]
0
lines = File.readlines(fn)
0
lines = lines[4..-1].join
Comments
No one has commented yet.