Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't expose stuff for the sake of tests, hell

  • Loading branch information...
commit 62348b2140b26a02da55c40cc0dab62d9f047a07 1 parent 7383139
@txus authored
Showing with 5 additions and 4 deletions.
  1. +2 −1  lib/springpad/api.rb
  2. +3 −3 test/springpad/api_test.rb
View
3  lib/springpad/api.rb
@@ -2,7 +2,8 @@
module Springpad
class API
- attr_reader :user, :password, :token
+ # Public: Initializes a new API instance with credentials stored in a
+ # configuration file.
def initialize
config = YAML.load(File.read(File.expand_path("~/.springpad")))
@user = config['user']
View
6 test/springpad/api_test.rb
@@ -6,9 +6,9 @@ module Springpad
let(:api) { API.new }
it 'initializes a user and password from ~/.springpad' do
- api.user.must_equal config['user']
- api.password.must_equal config['password']
- api.token.must_equal config['token']
+ api.instance_variable_get(:@user).must_equal config['user']
+ api.instance_variable_get(:@password).must_equal config['password']
+ api.instance_variable_get(:@token).must_equal config['token']
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.