summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2013-12-03 09:54:21 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2013-12-04 21:02:20 -0500
commit69b93cefcdcd4a80d241dc71d5e6de90842faf11 (patch)
treee41c230bba51dd8963cc2d0a2238a6bcb1a999a2 /spec/unit/puppet/provider/vcsrepo
parenta96a42e38b6c6d306ef158250658ae5673f383a3 (diff)
downloadpuppet-vcsrepo-69b93cefcdcd4a80d241dc71d5e6de90842faf11.tar.gz
puppet-vcsrepo-69b93cefcdcd4a80d241dc71d5e6de90842faf11.tar.bz2
Stripping git on_branch? return value; contains trailing newline
This commit also contains git provider `latest' method formatting changes; squashed by request.
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/git_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
index f3d9dd3..554645b 100644
--- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
@@ -296,6 +296,18 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
end
end
+ context "retrieving the current revision" do
+ before do
+ expects_chdir
+ provider.expects(:git).with('rev-parse', '--abbrev-ref', 'HEAD').returns("foo\n")
+ end
+
+ it "will strip trailing newlines" do
+ provider.expects(:get_revision).with('origin/foo')
+ provider.latest
+ end
+ end
+
describe 'latest?' do
before do
expects_chdir('/tmp/test')