spec/ohai/plugins/perl_spec.rb in ohai-0.5.0 vs spec/ohai/plugins/perl_spec.rb in ohai-0.5.2
- old
+ new
@@ -14,21 +14,21 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require File.join(File.dirname(__FILE__), '..', '..', '/spec_helper.rb')
+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
describe Ohai::System, "plugin perl" do
before(:each) do
@ohai = Ohai::System.new
@ohai[:languages] = Mash.new
@ohai.stub!(:require_plugin).and_return(true)
@pid = mock("PID", :null_object => true)
@stderr = mock("STDERR", :null_object => true)
@stdout = mock("STDOUT", :null_object => true)
- @stdout.stub!(:each).and_yield("version='5.8.8';").
+ @stdout.stub!(:each_line).and_yield("version='5.8.8';").
and_yield("archname='darwin-thread-multi-2level';")
@stdin = mock("STDIN", :null_object => true)
@status = 0
@ohai.stub!(:popen4).with("perl -V:version -V:archname").and_yield(
@pid,
@@ -47,10 +47,10 @@
@stdin.should_receive(:close)
@ohai._require_plugin("perl")
end
it "should iterate over each line of perl command's stdout" do
- @stdout.should_receive(:each).and_return(true)
+ @stdout.should_receive(:each_line).and_return(true)
@ohai._require_plugin("perl")
end
it "should set languages[:perl][:version]" do
@ohai._require_plugin("perl")