We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb1c53b commit 057286bCopy full SHA for 057286b
test/unit/plugins/pre_commit/checks/puppet_test.rb
@@ -0,0 +1,22 @@
1
+require 'minitest_helper'
2
+require 'plugins/pre_commit/checks/puppet'
3
+
4
+describe PreCommit::Checks::Puppet do
5
+ let(:check){ PreCommit::Checks::Puppet.new(nil, nil, []) }
6
7
+ it "succeeds if nothing changed" do
8
+ check.call([]).must_equal nil
9
+ end
10
11
+ it "succeeds if non-php file changed" do
12
+ check.call([fixture_file('bad-puppet.js')]).must_equal nil
13
14
15
+ it "succeeds if only good changes" do
16
+ check.call([fixture_file("good.pp")]).must_equal nil
17
18
19
+ it "fails if script fails" do
20
+ check.call([fixture_file("bad.pp")]).must_match(/Parse error/i)
21
22
+end
0 commit comments