Sha256: 3365d10ffd311271aa5ab0081f1b36c42bcc7abe007d7896bb94ed25e06ee445

Contents?: true

Size: 687 Bytes

Versions: 8

Compression:

Stored size: 687 Bytes

Contents

require 'spec_helper'

class TitledReport < Rescpos::Report
  attr_reader :title

  def initialize(title = '')
    @title = title
  end
end

describe Rescpos::Report do
  before(:all) do
    Rescpos.configure do |config|
      config.template_path = File.join(File.dirname(__FILE__), "../../reports")
    end
  end

  after(:all) do
    Rescpos.instance_variable_set(:@configuration, nil)
  end

  let(:report) { report = TitledReport.new('A title') }

  it 'renders the report with a string template' do
    report.render(:template => '<%= @title %>').should == 'A title'
  end

  it 'renders the report using default template file' do
    report.render.should == "A title\n"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rescpos-0.0.9 spec/lib/rescpos/report_spec.rb
rescpos-0.0.8 spec/lib/rescpos/report_spec.rb
rescpos-0.0.7 spec/lib/rescpos/report_spec.rb
rescpos-0.0.6 spec/lib/rescpos/report_spec.rb
rescpos-0.0.5 spec/lib/rescpos/report_spec.rb
rescpos-0.0.3 spec/lib/rescpos/report_spec.rb
rescpos-0.0.2 spec/lib/rescpos/report_spec.rb
rescpos-0.0.1 spec/lib/rescpos/report_spec.rb