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

- old
+ new

@@ -1,12 +1,12 @@ # encoding: utf-8 require 'spec_helper' describe Waddup::Source::Git 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 '#author' do it 'obtains author from git-config' do subject.stub(:run).and_return('John Doe') expect(subject.author).to eq 'John Doe' @@ -42,12 +42,12 @@ end end describe '#events_for_repo' do before do - subject.stub_shell "git --git-dir='/waddup/.git' log --author='John Doe' --since='2013-10-16T00:00:00+00:00' --until='2013-10-17T00:00:00+00:00' --format='format:%h %ai %s'", - :output => fixture('sources/git.log') + subject.stub_shell "git --git-dir='/waddup/.git' log --all --no-merges --author='John Doe' --since='2013-10-16' --until='2013-10-17' --format='format:%h %ai %s'", + output: fixture('sources/git.log') end it 'aggregates events for given repo' do subject.stub(:author).and_return('John Doe') events = subject.events_for_repo(from, to, '/waddup/.git') @@ -80,18 +80,18 @@ end describe '::usable?' do context 'when git is available' do before do - described_class.stub_shell 'git --version 2>&1', :exitstatus => 0 + described_class.stub_shell 'git --version 2>&1', exitstatus: 0 end it { should be_usable } end context 'when git is unavailable' do before do - described_class.stub_shell 'git --version 2>&1', :exitstatus => 1 + described_class.stub_shell 'git --version 2>&1', exitstatus: 1 end it { should_not be_usable } end end