spec/spec_helper.rb in socialcast-1.3.7 vs spec/spec_helper.rb in socialcast-1.3.8

- old
+ new

@@ -8,10 +8,15 @@ require_relative '../lib/socialcast' RSpec.configure do |config| config.mock_with :rspec + config.before do + stubbed_credentials = File.join(File.dirname(__FILE__), '..', 'fixtures') + Socialcast::CommandLine.stub(:config_dir).and_return(stubbed_credentials) + end + def capture_with_status(stream) exit_status = 0 begin stream = stream.to_s eval "$#{stream} = StringIO.new" @@ -23,9 +28,17 @@ result = eval("$#{stream}").string ensure eval("$#{stream} = #{stream.upcase}") end return result, exit_status + end + + def create_entry(entry_attributes) + Net::LDAP::Entry.new("dc=example,dc=com").tap do |e| + entry_attributes.each_pair do |attr, value| + e[attr] = value + end + end end def remove_directories(*names) project_dir = Pathname.new(Dir.pwd) names.each do |name|