Sha256: 5cffdf55f1ad977b3853299c9b2746c89ac1770effe7b1ee5a97bdb2c9127fa4

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

require File.join(File.dirname(__FILE__), "/../spec_helper")

describe "EvernoteOAuth::SharedNoteStore" do
  context "#initialize" do
    it "assigns instance variables" do
      sn = Struct.new(:shareKey).new('shareKey')
      auth_token = Struct.new(:authenticationToken).new('token')
      EvernoteOAuth::SharedNoteStore.any_instance.should_receive(
	:authenticateToSharedNotebook).and_return(auth_token)
      note_store = EvernoteOAuth::SharedNoteStore.new(client: 'client', shared_notebook: sn)
      note_store.instance_variable_get(:@client).should == 'client'
      note_store.token.should == 'token'
    end
  end
  context "#method_missing" do
    it "dispatches method" do
      mock_client = mock(Object)
      mock_client.should_receive(:send).with(:call_method, 'args')
      mock_client.class.should_receive(:instance_method).with(:call_method).and_return{
	Proc.new {|a| a}
      }
      sn = Struct.new(:shareKey).new('shareKey')
      auth_token = Struct.new(:authenticationToken).new('token')
      EvernoteOAuth::SharedNoteStore.any_instance.should_receive(
	:authenticateToSharedNotebook).and_return(auth_token)
      note_store = EvernoteOAuth::SharedNoteStore.new(client: mock_client, shared_notebook: sn)
      note_store.call_method('args')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
evernote_oauth-0.1.8 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.7 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.6 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.5 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.4 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.3 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.2 spec/evernote_oauth/shared_note_store_spec.rb
evernote_oauth-0.1.1 spec/evernote_oauth/shared_note_store_spec.rb