]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
fix broken tests
authormh <mh@immerda.ch>
Sun, 26 Jan 2014 14:25:48 +0000 (15:25 +0100)
committermh <mh@immerda.ch>
Sun, 26 Jan 2014 14:25:48 +0000 (15:25 +0100)
These tests were broken before, because they didn't mock the right
method.

spec/functions/ssh_keygen_spec.rb

index 0d2100d07e1fbebc2e0a3e49c596acf25e91c95c..a6b511735ccffa5cafc076d356e486d4fa6e8115 100644 (file)
@@ -80,34 +80,34 @@ describe 'ssh_keygen' do
       result[1].should == 'publickey'
     end
 
-    xit "should create the directory path if it does not exist" do
+    it "should create the directory path if it does not exist" do
       File.stubs(:exists?).with("/tmp/a/b/c").returns(false)
       File.stubs(:exists?).with("/tmp/a/b/c.pub").returns(false)
       File.stubs(:directory?).with("/tmp/a/b").returns(false)
       FileUtils.expects(:mkdir_p).with("/tmp/a/b", :mode => 0700)
-      Puppet::Util.expects(:execute).returns("")
+      Puppet::Util::Execution.expects(:execute).returns("")
       result = scope.function_ssh_keygen(['/tmp/a/b/c'])
       result.length.should == 2
       result[0].should == 'privatekey'
       result[1].should == 'publickey'
     end
 
-    xit "should generate the key if the keyfiles do not exist" do
+    it "should generate the key if the keyfiles do not exist" do
       File.stubs(:exists?).with("/tmp/a/b/c").returns(false)
       File.stubs(:exists?).with("/tmp/a/b/c.pub").returns(false)
       File.stubs(:directory?).with("/tmp/a/b").returns(true)
-      Puppet::Util.expects(:execute).with(['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', '/tmp/a/b/c', '-P', '', '-q']).returns("")
+      Puppet::Util::Execution.expects(:execute).with(['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', '/tmp/a/b/c', '-P', '', '-q']).returns("")
       result = scope.function_ssh_keygen(['/tmp/a/b/c'])
       result.length.should == 2
       result[0].should == 'privatekey'
       result[1].should == 'publickey'
     end
 
-    xit "should fail if something goes wrong during generation" do
+    it "should fail if something goes wrong during generation" do
       File.stubs(:exists?).with("/tmp/a/b/c").returns(false)
       File.stubs(:exists?).with("/tmp/a/b/c.pub").returns(false)
       File.stubs(:directory?).with("/tmp/a/b").returns(true)
-      Puppet::Util.expects(:execute).with(['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', '/tmp/a/b/c', '-P', '', '-q']).returns("something is wrong")
+      Puppet::Util::Execution.expects(:execute).with(['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', '/tmp/a/b/c', '-P', '', '-q']).returns("something is wrong")
       lambda {
         scope.function_ssh_keygen(["/tmp/a/b/c"])
       }.should( raise_error(Puppet::ParseError))