Re: [rspec-users] stubbing /mocking ldap within a method

2011-06-22 Thread Jed Schneider
Joe, Here is the solution I decided to go with, for now: describe Collaborator do describe "class_methods" do subject {Collaborator} it { should respond_to(:search_ldap).with(1).argument } it "should format the search term" do subject.prepare_search_term("Bob").should == "bob

Re: [rspec-users] stubbing /mocking ldap within a method

2011-06-21 Thread J. B. Rainsberger
On Tue, Jun 21, 2011 at 17:00, Jed Schneider wrote: > given I have the following with the internal assignments to filter and ldap: > class Collaborator >   def self.search_ldap(term) >     last_name = term.strip.split(/[, ]/).first.downcase >     filter = Net::LDAP::Filter.eq('surName', last_name)