Permalink
Browse files

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

  • Loading branch information...
1 parent 7383139 commit 62348b2140b26a02da55c40cc0dab62d9f047a07 @txus committed Dec 6, 2011
Showing with 5 additions and 4 deletions.
  1. +2 −1 lib/springpad/api.rb
  2. +3 −3 test/springpad/api_test.rb
View
@@ -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']
@@ -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

0 comments on commit 62348b2

Please sign in to comment.