spec/waddup/sources/apple_mail_spec.rb in waddup-0.0.2 vs spec/waddup/sources/apple_mail_spec.rb in waddup-0.1.0

- old
+ new

@@ -1,15 +1,15 @@ require 'spec_helper' describe Waddup::Source::AppleMail do - let(:from) { DateTime.new 2013, 10, 16 } - let(:to) { DateTime.new 2013, 10, 17 } + let(:from) { Date.new(2013, 10, 16) } + let(:to) { Date.new(2013, 10, 17) } describe '#events' do before do - subject.stub_shell "osascript -s s -e '#{described_class::SENT_MAIL_SCRIPT}' '16/10/2013 00:00' '17/10/2013 00:00'", - :output => fixture('sources/apple_mail.results') + subject.stub_shell "osascript -s s '#{described_class::SENT_MAIL_SCRIPT}' '16/10/2013 00:00' '17/10/2013 00:00'", + output: fixture('sources/apple_mail.results') end it 'aggregates events' do events = subject.events(from, to) @@ -26,18 +26,18 @@ described_class.stub(:osx?).and_return true end context 'when AppleScript is available' do before do - described_class.stub_shell 'osalang 2>&1', :output => 'AppleScript' + described_class.stub_shell 'osalang 2>&1', output: 'AppleScript' end it { should be_usable } end context 'when AppleScript is unavailable' do before do - described_class.stub_shell 'osalang 2>&1', :exitstatus => 1 + described_class.stub_shell 'osalang 2>&1', exitstatus: 1 end it { should_not be_usable } end end