aboutsummaryrefslogtreecommitdiffstats
path: root/spec/layouts_spec.rb
blob: 5ff9ccf16e73a227c5307c3ec160add09c138774 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'rspec'
require_relative '../lib/carlosgoce/calendar'
require_relative '../lib/carlosgoce/layout/layouts'

describe 'Layout simple' do
  before(:each) do
    @calendar = CarlosGoce::Calendar.new
    @layout = CarlosGoce::Layout::Simple.new
    @file = 'output/simple.pdf'
    FileUtils.rm_f(@file)
  end

  # Check the generated file on spec/output
  it 'creates a pdf' do
    @calendar.generate(@layout, @file, Date.today.year)
    expect(File.exist? @file).to be(true), lambda {"File #{@file} was not created"}
  end
end