Sha256: 2eee70a83ef61e9a695af8cab7b50049f0569ee498be757bf5cedc52a7b251c5

Contents?: true

Size: 712 Bytes

Versions: 5

Compression:

Stored size: 712 Bytes

Contents

require File.dirname(__FILE__) + "/helper"

module NirvanaHQTests
  
  class NirvanaHQAuthTest < Test::Unit::TestCase
  
    def setup
      @nirv = NirvanaHQ.new $nirvana_config
    end
  
    def test_token_file_exists
      assert File.exists?(NirvanaHQ::TOKEN_FILE)
    end
    
    def test_fetch_token
      token = @nirv.fetch_token
      assert_equal 32, token.length
    end

    def test_save_token_should_raise_empty_token_error
      #@q not sure if this best way to handle a raise? 
      # since its runtime error, there could be some other RTE error
      # how can i check the message? 
      assert_raise RuntimeError do
        @nirv.save_token!(nil)        
      end
    end
    
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nirvanahq-0.1.4 test/test_auth.rb
nirvanahq-0.1.3 test/test_auth.rb
nirvanahq-0.1.1 test/test_auth.rb
nirvanahq-0.1.0 test/test_auth.rb
nirvanahq-0.0.4 test/test_auth.rb