spec/balboa/punch_date_spec.rb in balboa-0.1.6 vs spec/balboa/punch_date_spec.rb in balboa-0.1.7
- old
+ new
@@ -9,10 +9,17 @@
punch_date = described_class.new(date, nil)
expect(punch_date.to_s).to eq('2011-01-01')
end
+ it 'responds to to_date' do
+ date = Date.new(2011, 1, 1)
+ punch_date = described_class.new(date, nil)
+
+ expect(punch_date.to_date).to eq(date)
+ end
+
it 'responds to strftime' do
date = Date.new(2011, 1, 1)
punch_date = described_class.new(date, nil)
expect(punch_date.strftime('%d/%m/%Y')).to eq('01/01/2011')
@@ -58,8 +65,21 @@
date = Date.new(2011, 4, 21)
punch_date = described_class.new(date, cli)
expect(punch_date.punchable?).to be true
+ end
+
+ it 'displays the holiday name' do
+ input = StringIO.new("yes\n")
+ output = StringIO.new
+ cli = HighLine.new(input, output)
+
+ date = Date.new(2011, 4, 21)
+ punch_date = described_class.new(date, cli)
+
+ punch_date.punchable?
+
+ expect(output.string).to match(/Tiradentes/)
end
end
end