spec/depl/main_spec.rb in depl-0.0.4 vs spec/depl/main_spec.rb in depl-0.0.5
- old
+ new
@@ -11,40 +11,42 @@
end
end
describe '#diff' do
it 'uses git to find the commits between two shas' do
- deploy.should_receive(:remote_sha).and_return("remote")
- deploy.should_receive(:local_sha).and_return("local")
+ expect(deploy).to receive(:remote_sha).and_return("remote")
+ expect(deploy).to receive(:local_sha).and_return("local")
- cmd = "git log --pretty=format:' %h %<(20)%an %ar\t %s' -10 remote..local"
- deploy.should_receive(:execute).with(cmd)
+ cmd = "git log --pretty=format:' %h %<(20)%an %ar\t %s' remote..local"
+ expect(deploy).to receive(:execute).with(cmd)
deploy.diff
end
end
- describe '#save_sha' do
+ describe '#advance_branch_pointer' do
it 'pushes a sha to the origin' do
- deploy.should_receive(:local_sha).and_return("12345")
+ expect(deploy).to receive(:local_sha).and_return("12345")
- cmd = "git push --force origin 12345:refs/heads/deploy-production"
- deploy.should_receive(:execute).with(cmd)
+ cmd = "git push --follow-tags --force origin 12345:refs/heads/deploy-production"
+ expect(deploy).to receive(:execute).with(cmd)
- deploy.save_sha
+ deploy.advance_branch_pointer
end
end
describe '#up_to_date' do
it 'returns true when shas match' do
- deploy.should_receive(:remote_sha).and_return("same")
- deploy.should_receive(:local_sha).and_return("same")
- expect(deploy.up_to_date).to be_true
+ expect(deploy).to receive(:remote_sha).and_return("same")
+ expect(deploy).to receive(:local_sha).and_return("same")
+
+ expect(deploy.up_to_date?).to be true
end
it 'returns true when shas differ' do
- deploy.should_receive(:remote_sha).and_return("remote")
- deploy.should_receive(:local_sha).and_return("local")
- expect(deploy.up_to_date).to be_false
+ expect(deploy).to receive(:remote_sha).and_return("remote")
+ expect(deploy).to receive(:local_sha).and_return("local")
+
+ expect(deploy.up_to_date?).to be false
end
end
end