aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/calendar_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/calendar_spec.rb b/spec/calendar_spec.rb
index e7fe00b..e37e18d 100644
--- a/spec/calendar_spec.rb
+++ b/spec/calendar_spec.rb
@@ -11,7 +11,7 @@ describe 'Calendar' do
end
it 'should be initialized with the current year' do
- expect(@calendar.year).to eq(Date.today.year)
+ expect(@calendar.year).to eq Date.today.year
end
describe 'Return a data structure with all needed data to generate a pdf' do
@@ -20,9 +20,15 @@ describe 'Calendar' do
end
it 'return month names localized' do
- expect(@calendar.to_h[1][:name]).to eq('january')
+ expect(@calendar.to_h[1][:name]).to eq 'january'
I18n.locale = 'es'
- expect(@calendar.to_h[1][:name]).to eq('enero')
+ expect(@calendar.to_h[1][:name]).to eq 'enero'
end
+
+ it 'return the numbers of available days for each month' do
+ @calendar = CarlosGoce::Calendar.new 2015
+ expect(@calendar.to_h[1][:days]).to eq (1..31).to_a
+ end
+
end
end \ No newline at end of file