Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing legacy tests.

  • Loading branch information...
commit d5c32ad2d42ae1d6ed5f83c7a6b98a8926fe9e7b 1 parent 3d9f05a
@jfi jfi authored
Showing with 1 addition and 46 deletions.
  1. +1 −3 README.md
  2. +0 −43 spec/api_spec.rb
View
4 README.md
@@ -103,9 +103,7 @@ and submit a pull request. Please add RSpec tests for your use case.
First, create a file at spec/spec_authentication_details containing the following:
- 34023ada3ec0d99213f91a12a2329ba932665ed7
- MyLegacyAPIUsername@mydomain.com
- MyPassword
+ YOUR_API_KEY_HERE
Substitute your own API key, username and password on lines 1, 2, and 3 of the file.
View
43 spec/api_spec.rb
@@ -3,8 +3,6 @@
describe "API" do
let(:test_api_key) { IO.read( File.join( File.dirname(__FILE__) + "/spec_authentication_details" ) ).split("\n")[0] }
- let(:test_username) { IO.read( File.join( File.dirname(__FILE__) + "/spec_authentication_details" ) ).split("\n")[1] }
- let(:test_password) { IO.read( File.join( File.dirname(__FILE__) + "/spec_authentication_details" ) ).split("\n")[2] }
describe "#initialize" do
@@ -31,19 +29,6 @@
api.api_key.should == 'af7a8f7a8fa7f8a76fa876fa876a876fa875a875'
end
- it "should raise an ArgumentError if two paramters are passed but either username or password is blank" do
- expect { Clockwork::API.new('username', '') }.to raise_error ArgumentError
- expect { Clockwork::API.new('password', '') }.to raise_error ArgumentError
- expect { Clockwork::API.new('', '') }.to raise_error ArgumentError
- end
-
- it "should return a valid instance of Clockwork::API if a valid username and password are passed" do
- api = Clockwork::API.new 'username', 'password'
- api.should be_a_kind_of Clockwork::API
- api.username.should == 'username'
- api.password.should == 'password'
- end
-
it "should raise an ArgumentError if more than three parameters are passed" do
expect { Clockwork::API.new('', '', '') }.to raise_error ArgumentError
end
@@ -55,14 +40,6 @@
api.truncate.should == true
api.invalid_char_action.should == :remove
end
-
- it "should set options if a parameters hash is passed along with the username and password" do
- api = Clockwork::API.new 'af7a8f7a8fa7f8a76fa876fa876a876fa875a875', { :from => 'A Test', :long => false, :truncate => false, :invalid_char_action => :remove }
- api.from.should == "A Test"
- api.long.should == false
- api.truncate.should == false
- api.invalid_char_action.should == :remove
- end
end
@@ -86,21 +63,11 @@
describe "#credit" do
- it "should return the number of messages remaining with a valid username and password" do
- api = Clockwork::API.new test_username, test_password
- api.credit.should be > 0
- end
-
it "should return the number of messages remaining with an API key" do
api = Clockwork::API.new test_api_key
api.credit.should be > 0
end
- it "should raise an error with an invalid username and password" do
- api = Clockwork::API.new 'username', 'password'
- expect { api.credit }.to raise_error Clockwork::Error::Authentication
- end
-
it "should raise an error with an invalid API key" do
api = Clockwork::API.new 'a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1'
expect { api.credit }.to raise_error Clockwork::Error::Generic
@@ -110,11 +77,6 @@
describe "#get_credit" do
- it "should return the number of messages remaining with a valid username and password" do
- api = Clockwork::API.new test_username, test_password
- api.get_credit.should be > 0
- end
-
it "should return the number of messages remaining with an API key" do
api = Clockwork::API.new test_api_key
api.get_credit.should be > 0
@@ -126,11 +88,6 @@
api.get_credit.should be > 0
end
- it "should raise an error with an invalid username and password" do
- api = Clockwork::API.new 'username', 'password'
- expect { api.get_credit }.to raise_error Clockwork::Error::Authentication
- end
-
it "should raise an error with an invalid API key" do
api = Clockwork::API.new 'a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1'
expect { api.get_credit }.to raise_error Clockwork::Error::Generic
Please sign in to comment.
Something went wrong with that request. Please try again.