Skip to content
Browse files

Make tests run under Ruby 1.8.x

  • Loading branch information...
1 parent 35052a6 commit c4acc753866f59b3535c70c44f6209f745350c09 Steve Ellis committed
Showing with 5 additions and 6 deletions.
  1. +2 −1 test/helper.rb
  2. +3 −5 test/test_sms.rb
View
3 test/helper.rb
@@ -1,4 +1,5 @@
+require 'rubygems'
require 'test/unit'
require 'mocha'
-require File.join(File.dirname(__FILE__), '../lib/sms')
+require File.join(File.dirname(__FILE__), '../lib/sms')
View
8 test/test_sms.rb
@@ -35,8 +35,7 @@ def test_sending_sms_with_env_set
link = "/2008-08-01/Accounts/#{ENV['TWILIO_ID']}/SMS/Messages"
twilio = mock()
- twilio.expects(:request).with(link, "POST", {'To' => TO_NUMBER, 'From' => FROM_NUMBER, 'Body' => MESSAGE})
- .returns(mock(:code => SUCCESS_CODE))
+ twilio.expects(:request).with(link, "POST", {'To' => TO_NUMBER, 'From' => FROM_NUMBER, 'Body' => MESSAGE}).returns(mock(:code => SUCCESS_CODE))
Twilio::RestAccount.expects(:new).with("twilio_id", "twilio_secret").returns(twilio)
assert_equal(true, SMS.text(MESSAGE, :from => FROM_NUMBER, :to => TO_NUMBER))
@@ -48,10 +47,9 @@ def test_sending_sms_without_env_set
link = "/2008-08-01/Accounts/#{SMS.twilio_id}/SMS/Messages"
twilio = mock()
- twilio.expects(:request).with(link, "POST", {'To' => TO_NUMBER, 'From' => FROM_NUMBER, 'Body' => MESSAGE})
- .returns(mock(:code => SUCCESS_CODE))
+ twilio.expects(:request).with(link, "POST", {'To' => TO_NUMBER, 'From' => FROM_NUMBER, 'Body' => MESSAGE}).returns(mock(:code => SUCCESS_CODE))
Twilio::RestAccount.expects(:new).with("twilio_id", "twilio_secret").returns(twilio)
assert_equal(true, SMS.text(MESSAGE, :from => FROM_NUMBER, :to => TO_NUMBER))
end
-end
+end

0 comments on commit c4acc75

Please sign in to comment.
Something went wrong with that request. Please try again.