aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Goce <carlosgoce@gmail.com>2015-01-23 20:29:00 +0100
committerCarlos Goce <carlosgoce@gmail.com>2015-01-23 20:29:00 +0100
commitd1d3d417b77d73b87273bec06b28604de494c07d (patch)
tree058c24608ad90e28b391ce5a9ba229653246393f
parent77b432f7914736f4c8507693563790e5cae0aa7a (diff)
downloadpdf-calendars-d1d3d417b77d73b87273bec06b28604de494c07d.tar.gz
pdf-calendars-d1d3d417b77d73b87273bec06b28604de494c07d.tar.bz2
pdf-calendars-d1d3d417b77d73b87273bec06b28604de494c07d.zip
Add year
-rw-r--r--lib/carlosgoce/calendar.rb4
-rw-r--r--lib/carlosgoce/layouts.rb2
-rw-r--r--spec/calendar_spec.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/carlosgoce/calendar.rb b/lib/carlosgoce/calendar.rb
index 429cc0e..1166f55 100644
--- a/lib/carlosgoce/calendar.rb
+++ b/lib/carlosgoce/calendar.rb
@@ -30,8 +30,8 @@ module CarlosGoce
}
end
- def generate(layout, file)
- layout.create file, to_h
+ def generate(layout, file, year)
+ layout.create file, to_h, year
end
end
end
diff --git a/lib/carlosgoce/layouts.rb b/lib/carlosgoce/layouts.rb
index 962f8cb..f3e171c 100644
--- a/lib/carlosgoce/layouts.rb
+++ b/lib/carlosgoce/layouts.rb
@@ -1,6 +1,6 @@
module CarlosGoce
class Layout
- def create(file, hash)
+ def create(file, hash, year)
end
end
diff --git a/spec/calendar_spec.rb b/spec/calendar_spec.rb
index f13cf93..3680b3b 100644
--- a/spec/calendar_spec.rb
+++ b/spec/calendar_spec.rb
@@ -41,16 +41,16 @@ describe 'Calendar' do
I18n.locale = 'es'
expect(@calendar.to_h[1][:days_names].first).to eq 'jueves'
end
-
end
describe 'Can generate a pdfs' do
it 'should receive a layout and pass it the data to create the specified file' do
layout = instance_double('CarlosGoce::Layout')
file = 'destionation.pdf'
- expect(layout).to receive(:create).with(file, @calendar.to_h)
+ year = 2015
+ expect(layout).to receive(:create).with(file, @calendar.to_h, year)
- @calendar.generate(layout, file)
+ @calendar.generate(layout, file, year)
end
end
end \ No newline at end of file