Sha256: acc37239969c244e96945a36901cde7bd7dba1ce87f1fe78968c5b8016786a57

Contents?: true

Size: 713 Bytes

Versions: 1

Compression:

Stored size: 713 Bytes

Contents

require 'helper'

class TestClient < Test::Unit::TestCase

  def test_load
    mock(Stars::Formatter).new.with_any_args
    mock(Stars::Client).puts.with_any_args
    Stars::Client.load!
  end
  
  def test_username_when_exists
    mock(File).exists?.with_any_args.returns(true)
    mock(File).read.with_any_args
    Stars::Client.username
  end
  
  def test_username_when_nonexistant
    mock(File).exists?.with_any_args.returns(false)
    mock(Stars::Client).prompt_for_username
    Stars::Client.username
  end
  
  def test_write_home_config
    assert_equal Stars::Client.remember_username('holman'), 'holman'
  end
  
  def test_config_path
    assert Stars::Client.config_path.index('.stars')
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stars-0.1.0 test/test_client.rb