ghempton / camcorder

VCR not enough? Record arbitrary method invocations for later playback.
MIT License
86 stars 10 forks source link

I'm Not able to use it, got NoMethodError. #5

Closed amoludage closed 9 years ago

amoludage commented 9 years ago

I'm trying this on irb console i.e 2.2.0 :001 > require 'gmail' 2.2.0 :002 > require 'camcorder' 2.2.0 :003> imap = Camcorder::Proxy.new(Net::IMAP,'imap.gmail.com', 993, true, nil, false) this gives successful response as---- --

"Camcorder::Proxy:0x00000001c5c028 @klass="imap.gmail.com", @init_args=[993, true, nil, false], @recorder=Net::IMAP, @side_effects="e6bd2fbfc8ef76c22f26bd5758f20098" "

but after that I'm requesting for login i.e

2.2.0 :004 > imap.login('amolishere', 'amol123')

then i got response as ----------

NoMethodError: undefined method name' for "imap.gmail.com":String from /home/amol/.rvm/gems/ruby-2.2.0/gems/camcorder-0.0.4/lib/camcorder/proxy.rb:41:in_record' from /home/amol/.rvm/gems/ruby-2.2.0/gems/camcorder-0.0.4/lib/camcorder/proxy.rb:52:in method_missing' from (irb):4 from /home/amol/.rvm/rubies/ruby-2.2.0/bin/irb:11:in

'

Please help me to solve this?

Thank you.

ghempton commented 9 years ago

Looks like there is an error in README.md (PR would be much appreciated). It should instead be:

recorder = Camcorder::Recorder.new('recordings.json')
imap = Camcorder::Proxy.new(recorder, Net::IMAP,'imap.gmail.com', 993, true, nil, false))

A recorder needs to be passed in as well.

amoludage commented 9 years ago

It works, Thank you very much.. :p