forked from twilio/twilio-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ObsoleteClient to handle instantiations of clients from old library (t…
…wilio#341) * ObsoleteClient to handle instantiations of clients from old library * Added pre-commit hook
- Loading branch information
Showing
6 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,8 @@ def to_s | |
"[HTTP #{status_code}] #{code} : #{message}" | ||
end | ||
end | ||
|
||
class ObsoleteError < StandardError | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Twilio | ||
module REST | ||
class ObsoleteClient | ||
def initialize(*) | ||
raise ObsoleteError, "#{self.class} has been removed from this version of the library. "\ | ||
'Please refer to current documentation for guidance.' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
require 'spec_helper' | ||
|
||
describe Twilio::REST::ObsoleteClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::ObsoleteClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::BaseClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::BaseClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::IpMessagingClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::IpMessagingClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::LookupsClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::LookupsClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::MonitorClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::MonitorClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::PricingClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::PricingClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::TaskRouterClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::TaskRouterClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end | ||
|
||
describe Twilio::REST::TrunkingClient do | ||
it 'raise an exception' do | ||
expect { Twilio::REST::TrunkingClient.new }.to raise_error(Twilio::REST::ObsoleteError) | ||
end | ||
end |