Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

WIP: Spec code clean up -- first pass

  • Loading branch information...
commit f3e558c7f33abf4961ed655e93ed9011da606202 1 parent 6cdc0b3
@geopet geopet authored
Showing with 47 additions and 49 deletions.
  1. +35 −40 spec/rest/account_spec.rb
  2. +12 −9 spec/rest/call_spec.rb
View
75 spec/rest/account_spec.rb
@@ -1,63 +1,58 @@
require 'spec_helper'
describe Twilio::REST::Account do
- it 'should set up an incoming phone numbers resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:incoming_phone_numbers).should == true
- account.incoming_phone_numbers.instance_variable_get('@uri').should == 'someUri/IncomingPhoneNumbers'
+
+ before do
+ @account = Twilio::REST::Account.new('someUri', 'someClient')
+ end
+
+ it 'sets up incoming phone numbers resources object' do
+ @account.respond_to?(:incoming_phone_numbers).should == true
+ @account.incoming_phone_numbers.instance_variable_get('@uri').should == 'someUri/IncomingPhoneNumbers'
end
- it 'should set up an available phone numbers resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:available_phone_numbers).should == true
- account.available_phone_numbers.instance_variable_get('@uri').should == 'someUri/AvailablePhoneNumbers'
+ it 'sets up an available phone numbers resources object' do
+ @account.respond_to?(:available_phone_numbers).should == true
+ @account.available_phone_numbers.instance_variable_get('@uri').should == 'someUri/AvailablePhoneNumbers'
end
- it 'should set up an outgoing caller ids resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:outgoing_caller_ids).should == true
- account.outgoing_caller_ids.instance_variable_get('@uri').should == 'someUri/OutgoingCallerIds'
+ it 'sets up an outgoing caller ids resources object' do
+ @account.respond_to?(:outgoing_caller_ids).should == true
+ @account.outgoing_caller_ids.instance_variable_get('@uri').should == 'someUri/OutgoingCallerIds'
end
- it 'should set up a calls resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:calls).should == true
- account.calls.instance_variable_get('@uri').should == 'someUri/Calls'
+ it 'sets up a calls resources object' do
+ @account.respond_to?(:calls).should == true
+ @account.calls.instance_variable_get('@uri').should == 'someUri/Calls'
end
- it 'should set up a conferences resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:conferences).should == true
- account.conferences.instance_variable_get('@uri').should == 'someUri/Conferences'
+ it 'sets up a conferences resources object' do
+ @account.respond_to?(:conferences).should == true
+ @account.conferences.instance_variable_get('@uri').should == 'someUri/Conferences'
end
- it 'should set up a queues resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:queues).should == true
- account.queues.instance_variable_get('@uri').should == 'someUri/Queues'
+ it 'sets up a queues resources object' do
+ @account.respond_to?(:queues).should == true
+ @account.queues.instance_variable_get('@uri').should == 'someUri/Queues'
end
- it 'should set up a sms resource object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:sms).should == true
- account.sms.instance_variable_get('@uri').should == 'someUri/SMS'
+ it 'sets up a sms resource object' do
+ @account.respond_to?(:sms).should == true
+ @account.sms.instance_variable_get('@uri').should == 'someUri/SMS'
end
- it 'should set up a recordings resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:recordings).should == true
- account.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
+ it 'sets up a recordings resources object' do
+ @account.respond_to?(:recordings).should == true
+ @account.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
end
- it 'should set up a transcriptions resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:transcriptions).should == true
- account.transcriptions.instance_variable_get('@uri').should == 'someUri/Transcriptions'
+ it 'sets up a transcriptions resources object' do
+ @account.respond_to?(:transcriptions).should == true
+ @account.transcriptions.instance_variable_get('@uri').should == 'someUri/Transcriptions'
end
- it 'should set up a notifications resources object' do
- account = Twilio::REST::Account.new('someUri', 'someClient')
- account.respond_to?(:notifications).should == true
- account.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
+ it 'sets up a notifications resources object' do
+ @account.respond_to?(:notifications).should == true
+ @account.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
end
end
View
21 spec/rest/call_spec.rb
@@ -1,15 +1,18 @@
require 'spec_helper'
describe Twilio::REST::Call do
- it 'should set up a recordings resources object' do
- call = Twilio::REST::Call.new('someUri', 'someClient')
- call.respond_to?(:recordings).should == true
- call.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
+
+ before do
+ @call = Twilio::REST::Call.new('someUri', 'someClient')
+ end
+
+ it 'sets up a recordings resources object' do
+ @call.respond_to?(:recordings).should == true
+ @call.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
end
- it 'should set up a notifications resources object' do
- call = Twilio::REST::Call.new('someUri', 'someClient')
- call.respond_to?(:notifications).should == true
- call.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
+ it 'sets up a notifications resources object' do
+ @call.respond_to?(:notifications).should == true
+ @call.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.