summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe <glen@delfi.ee>2013-09-12 01:42:54 +0300
committerBryan McLellan <btm@opscode.com>2013-11-25 11:32:43 -0800
commitfe5489b10d0656d02abafff9c9de7242aa9109fe (patch)
tree7c958bbfbe5c05d020558c2121af337b450f3a06
parent0221aed83bbf765a1cb41a948f972428e61e8197 (diff)
downloadohai-fe5489b10d0656d02abafff9c9de7242aa9109fe.tar.gz
[OHAI-358] add test for php version parse
-rw-r--r--spec/unit/plugins/php_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/plugins/php_spec.rb b/spec/unit/plugins/php_spec.rb
index fac70509..78c3a977 100644
--- a/spec/unit/plugins/php_spec.rb
+++ b/spec/unit/plugins/php_spec.rb
@@ -48,6 +48,15 @@ describe Ohai::System, "plugin php" do
@plugin.languages.should_not have_key(:php)
end
+ it "should parse builddate even if it's suhosin patched" do
+ @status = 1
+ @stdout = "PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30) \nCopyright (c) 1997-2013 The PHP Group\nZend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies"
+ @stderr = ""
+ @plugin.stub(:run_command).with({:no_status_check=>true, :command=>"php -v"}).and_return([@status, @stdout, @stderr])
+ @plugin.run
+ @plugin.languages[:php][:builddate].should eql("Aug 30 2013 04:30:30")
+ end
+
#########
test_plugin([ "languages", "php" ], [ "php" ]) do | p |