manlycode / sms-spec

A Ruby library for testing SMS Messages using RSpec and Cucumber.
16 stars 11 forks source link

Spec class should be as flexible as Twilio class #13

Open martinstreicher opened 9 years ago

martinstreicher commented 9 years ago
@client = Twilio::REST::Client.new account_sid, auth_token

# alternatively, you can preconfigure the client like so
Twilio.configure do |config|
  config.account_sid = account_sid
  config.auth_token = auth_token
end

# and then you can create a new client without parameters
@client = Twilio::REST::Client.new

However, the sms-spec entry point for Client.new requires arguments. So if you use the convenience code above, things break when including the test tool.

martinstreicher commented 9 years ago
 1) Sms::Message Instance Methods #send returns a Twilio result
     Failure/Error: message = described_class.send message: :message, number: cell_number
     ArgumentError:
       wrong number of arguments (0 for 2)
     # /Users/mss67/.rvm/gems/ruby-2.1.2@dusk/gems/sms-spec-0.1.7/lib/sms_spec/drivers/twilio-ruby.rb:3:in `initialize'
rosskevin commented 9 years ago

My pull request solves this:

https://github.com/manlycode/sms-spec/pull/20