diff options
Diffstat (limited to 'spec/layouts_spec.rb')
-rw-r--r-- | spec/layouts_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/layouts_spec.rb b/spec/layouts_spec.rb new file mode 100644 index 0000000..5ff9ccf --- /dev/null +++ b/spec/layouts_spec.rb @@ -0,0 +1,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
\ No newline at end of file |