Dir.glob returns an array, but a test was stubbing it to return a
string.  In Ruby 1.8.7 if you call enumerable methods (each, collect,
etc) on a string, the string is split on \n first.  This meant the poor
stubbing didn't affect 1.8.7, but 1.9.2 is more strict and won't
automatically convert when you call enumerable methods on strings.

Paired-with: Josh Cooper <j...@puppetlabs.com>
Signed-off-by: Matt Robinson <m...@puppetlabs.com>
---
Local-branch: ticket/next/7507-ruby19_fix
 spec/unit/physicalprocessorcount_spec.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/spec/unit/physicalprocessorcount_spec.rb 
b/spec/unit/physicalprocessorcount_spec.rb
index 260788b..e1f7c60 100644
--- a/spec/unit/physicalprocessorcount_spec.rb
+++ b/spec/unit/physicalprocessorcount_spec.rb
@@ -14,7 +14,7 @@ describe "Physical processor count facts" do
     it "should return one physical CPU" do
         Facter.fact(:kernel).stubs(:value).returns("Linux")
         File.stubs(:exists?).with('/sys/devices/system/cpu').returns(true)
-        
Dir.stubs(:glob).with("/sys/devices/system/cpu/cpu*/topology/physical_package_id").returns("/sys/devices/system/cpu/cpu0/topology/physical_package_id")
+        
Dir.stubs(:glob).with("/sys/devices/system/cpu/cpu*/topology/physical_package_id").returns(["/sys/devices/system/cpu/cpu0/topology/physical_package_id"])
         Facter::Util::Resolution.stubs(:exec).with("cat 
/sys/devices/system/cpu/cpu0/topology/physical_package_id").returns("0")
 
         Facter.fact(:physicalprocessorcount).value.should == 1
-- 
1.7.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to