Sha256: e210803105ee5040b10f2d0d42954f79f7b2d2d3c9e03d3b13f7d47451eac02c
Contents?: true
Size: 872 Bytes
Versions: 17
Compression:
Stored size: 872 Bytes
Contents
require 'spec_helper' require 'r10k/git' describe R10K::Git::Commit do let(:ref) { '96eeaba8c5069e31400a3dfcbeb37d016c1b1980' } let(:repo) { double('git repository') } subject { described_class.new(ref) } describe "determining if the commit can be resolved" do before do subject.repository = repo end it "is true if the commit can be rev-parsed" do expect(repo).to receive(:rev_parse).with(ref).and_return ref expect(subject).to be_resolvable end it "is true if the commit cannot be rev-parsed" do expect(repo).to receive(:rev_parse).with(ref).and_raise(R10K::Git::UnresolvableRefError, :ref => ref) expect(subject).to_not be_resolvable end end it "can be converted to a string" do expect(subject.to_s).to eq ref end it_behaves_like "a git ref" it_behaves_like "an immutable git ref" end
Version data entries
17 entries across 17 versions & 1 rubygems