Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
83 additions
and
35 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
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
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
40 changes: 40 additions & 0 deletions
40
spec/activesms/connection_adapters/abstract_adapter_spec.rb
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,40 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | ||
require 'net/https' | ||
|
||
include ConnectionAdapters | ||
|
||
describe AbstractAdapter do | ||
|
||
before(:each) do | ||
@abstract_adapter = AbstractAdapter.new(nil) | ||
end | ||
|
||
it "should instantiate" do | ||
violated unless @abstract_adapter | ||
end | ||
|
||
it "should have a name" do | ||
@abstract_adapter.adapter_name.should eql("Abstract") | ||
end | ||
|
||
it "should have a default deliver method, to be implemented by subclasses" do | ||
@abstract_adapter.should_receive(:deliver) | ||
@abstract_adapter.deliver(mock(Sms)) | ||
end | ||
|
||
it "should respond to parse with nil.. for some obscure reason" do | ||
@abstract_adapter.parse(mock(Sms)).should eql(nil) | ||
end | ||
|
||
it "should generate a http request with a valid url" do | ||
class A < AbstractAdapter | ||
def deliver | ||
send_http_request('http://yahoo.com?teste=4', {:teste => 1}) | ||
end | ||
end | ||
@a = A.new | ||
@a.deliver.should eql(1) | ||
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