X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Fvendor_spec.rb;fp=spec%2Funit%2Fvendor_spec.rb;h=4d590647d468dd60e9a11ffe685aae6cefe6731b;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/spec/unit/vendor_spec.rb b/spec/unit/vendor_spec.rb new file mode 100755 index 0000000..4d59064 --- /dev/null +++ b/spec/unit/vendor_spec.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env rspec + +require 'spec_helper' + +module MCollective + describe Vendor do + describe "#vendor_dir" do + it "should return correct vendor directory" do + specdir = File.dirname(__FILE__) + expected_dir = File.expand_path("#{specdir}/../../lib/mcollective/vendor") + Vendor.vendor_dir.should == expected_dir + end + end + + describe "#load_entry" do + it "should attempt to load the correct path" do + specdir = File.dirname(__FILE__) + expected_dir = File.expand_path("#{specdir}/../../lib/mcollective/vendor") + + Class.any_instance.stubs("load").with("#{expected_dir}/foo").once + + Vendor.load_entry("foo") + end + end + + describe "#require_libs" do + it "should require the vendor loader" do + Class.any_instance.stubs("require").with("mcollective/vendor/require_vendored").once + + Vendor.require_libs + end + end + end +end