Sha256: 2368e1055d63db4f2ab186659ead2c8679bcca8e9b8cb16452d0f035b6cd28f1

Contents?: true

Size: 601 Bytes

Versions: 9

Compression:

Stored size: 601 Bytes

Contents

require "spec_helper"

describe "StaticMatic::Template" do
  before do
    setup_staticmatic
    
    template_file = File.join(TEST_SITE_PATH, "src", "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

9 entries across 9 versions & 1 rubygems

Version Path
staticmatic2-2.1.8 spec/template_error_spec.rb
staticmatic2-2.1.7 spec/template_error_spec.rb
staticmatic2-2.1.6 spec/template_error_spec.rb
staticmatic2-2.1.5 spec/template_error_spec.rb
staticmatic2-2.1.4 spec/template_error_spec.rb
staticmatic2-2.1.3 spec/template_error_spec.rb
staticmatic2-2.1.2 spec/template_error_spec.rb
staticmatic2-2.1.1 spec/template_error_spec.rb
staticmatic2-2.1.0 spec/template_error_spec.rb