Sha256: 4e9ec07e492881ea2465101e31d52e3d7e65a92e9f19d98c716d5102ddab8598

Contents?: true

Size: 1.93 KB

Versions: 26

Compression:

Stored size: 1.93 KB

Contents

require 'spec_helper'

describe Stasis::Before do

  before(:all) do
    generate
  end
  
  it "should set class variables for index.html" do
    $files['index.html'].should =~ /@before_index_literal\nroot/
    $files['index.html'].should =~ /@before_index_regexp\nroot/
    $files['index.html'].should =~ /@before_all\nroot/
    $files['index.html'].should =~ /@fail\nfalse/
  end

  it "should set class variables for subdirectory/index.html" do
    $files['subdirectory/index.html'].should =~ /@before_index_literal\nsubdirectory/
    $files['subdirectory/index.html'].should =~ /@before_index_regexp\nsubdirectory/
    $files['subdirectory/index.html'].should =~ /@before_all\nsubdirectory/
    $files['subdirectory/index.html'].should =~ /@fail\nfalse/
  end

  it "should set class variables for no_controller/index.html" do
    $files['no_controller/index.html'].should =~ /@before_index_literal\nno_controller/
    $files['no_controller/index.html'].should =~ /@before_index_regexp\nroot/
    $files['no_controller/index.html'].should =~ /@before_all\nroot/
    $files['no_controller/index.html'].should =~ /@fail\nfalse/
  end

  it "should render text to before_render_text.html" do
    $files['before_render_text.html'].should =~ /root/
  end

  it "should render text to subdirectory/before_render_text.html" do
    $files['subdirectory/before_render_text.html'].should =~ /subdirectory/
  end

  it "should render partial to before_render_text.html" do
    $files['before_render_partial.html'].should =~ /root/
  end

  it "should render partial to subdirectory/before_render_text.html" do
    $files['subdirectory/before_render_partial.html'].should =~ /subdirectory/
  end

  it "should render partial to before_non_existent.html" do
    $files['before_non_existent.html'].should =~ /root/
  end

  it "should render partial to subdirectory/before_non_existent.html" do
    $files['subdirectory/before_non_existent.html'].should =~ /subdirectory/
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
stasis-0.2.0 spec/stasis/plugins/before_spec.rb
stasis-0.2.0.pre spec/stasis/plugins/before_spec.rb
stasis-0.1.23 spec/stasis/plugins/before_spec.rb
stasis-0.1.22 spec/stasis/plugins/before_spec.rb
stasis-0.1.21 spec/stasis/plugins/before_spec.rb
stasis-0.1.20 spec/stasis/plugins/before_spec.rb
stasis-0.1.19 spec/stasis/plugins/before_spec.rb
stasis-0.1.18 spec/stasis/plugins/before_spec.rb
stasis-0.1.17 spec/stasis/plugins/before_spec.rb
stasis-0.1.16 spec/stasis/plugins/before_spec.rb
stasis-0.1.15 spec/stasis/plugins/before_spec.rb
stasis-0.1.14 spec/stasis/plugins/before_spec.rb
stasis-0.1.13 spec/stasis/plugins/before_spec.rb
stasis-0.1.12 spec/stasis/plugins/before_spec.rb
stasis-0.1.11 spec/stasis/plugins/before_spec.rb
stasis-0.1.10 spec/stasis/plugins/before_spec.rb
stasis-0.1.9 spec/stasis/plugins/before_spec.rb
stasis-0.1.8 spec/stasis/plugins/before_spec.rb
stasis-0.1.7 spec/stasis/plugins/before_spec.rb
stasis-0.1.6 spec/stasis/plugins/before_spec.rb