Sha256: bf9b4580ae73e6760536e3f406f51e861836494acaf83276dae0f941a86a5f80

Contents?: true

Size: 993 Bytes

Versions: 4

Compression:

Stored size: 993 Bytes

Contents

Given /^I am using the Skype Api testing fake$/ do
  # Silence constant re-assignment warning.
  original_verbosity = $VERBOSE
  $VERBOSE = nil
  Rype::Api = Rype::FakeApi
  $VERBOSE = original_verbosity
end

Given /^there is a chat with id "([^\"]*)"$/ do |chat_id|
  # Let's assume it exists.
end

Given /^a client has registered a callback for notifications about "([^\"]*)"$/ do |scope|
  @callback = lambda do
    if @called
      @called
    else
      @called = true
      false
    end
  end
  Rype::Api.on_notification(scope, @callback)
end

When /^I send a chatmessage "([^\"]*)" to "([^\"]*)"$/ do |message_body, chat_id|
  Rype::Chat.new(chat_id).send_message(message_body)
end

When /^Skype issues a notification "([^\"]*)"$/ do |notification|
  Rype::Api.notify(notification)
end

Then /^the Skype Api should receive the message$/ do |string|
  Rype::Api.recorded_messages.should include(string)
end

Then /^the callback should be called$/ do
  @callback.call.should be_true
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rype-0.0.4 features/step_definitions/skype_steps.rb
rype-0.0.3 features/step_definitions/skype_steps.rb
rype-0.0.2 features/step_definitions/skype_steps.rb
rype-0.0.1 features/step_definitions/skype_steps.rb