Sha256: b10f866fb5a4ce41f20fa552aceb2c19228028a1e29c3b9b53a4c311621fc9fe

Contents?: true

Size: 635 Bytes

Versions: 21

Compression:

Stored size: 635 Bytes

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe "StaticMatic::Template" do
  before do
    setup_staticmatic
    
    template_file = File.join(TEST_SITE_PATH, "src", "pages", "page_with_error.haml")
    
    begin
      @staticmatic.generate_html_from_template_source(File.read(template_file))
    rescue Exception => e
      @template_error = StaticMatic::TemplateError.new(template_file, e)
    end
  end
  
  it "extract source around line number" do
    @template_error.source_extract.should match(/\- bang\!/)
  end
  
  it "extract line number from backtrace" do
    @template_error.line_number.should == "3"
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
staticmatic2-2.0.2 spec/template_error_spec.rb
staticmatic2-2.0.1 spec/template_error_spec.rb
staticmatic2-2.0.0 spec/template_error_spec.rb
staticmatic-0.11.1 spec/template_error_spec.rb
staticmatic-0.11.0 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.10 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.9 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.8 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.7 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.6 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.5 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.4 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.3 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.1 spec/template_error_spec.rb
staticmatic-0.11.0.alpha.0 spec/template_error_spec.rb
staticmatic-0.10.8 spec/template_error_spec.rb
staticmatic-0.10.7 spec/template_error_spec.rb
staticmatic-0.10.6 spec/template_error_spec.rb
staticmatic-0.10.5 spec/template_error_spec.rb
staticmatic-0.10.4 spec/template_error_spec.rb