Sha256: 1740058069beb1d11f51788157cd7af95d8e9b78ddae1807415bd45edd4d9ee2

Contents?: true

Size: 946 Bytes

Versions: 14

Compression:

Stored size: 946 Bytes

Contents

require 'spec_helper'
require 'app42/base/constants'

describe 'App42::Command' do
  describe 'UserToken' do

  	it 'should ensure config dir' do
      FileUtils.mkdir_p(config_path).first.should eql "#{Dir.home}/.app42"     
  	end

  	it 'should check key file presence?' do
      info = YAML.load_file(key_path)
      info['api_key'].should_not be_nil
      info['secret_key'].should_not be_nil
  	end

  	it 'should return config path' do
  	  config_path.should eql "#{Dir.home}/.app42"
  	end

  	it 'should return key_file' do
  	  key_path.should eql "#{Dir.home}/.app42/app42paas.yml"
      expect(key_path).to end_with(".yml")
  	end

    # it 'should remove key file' do
    #   FileUtils.rm_f(key_path)
    #   expect { YAML.load_file(key_path) }.to raise_error(Errno::ENOENT)
    # end

  	def config_path
      File.expand_path(App42::CONFIG_DIR)
    end

    def key_path
      File.expand_path(App42::KEYS_FILE)
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
app42-0.7.0 spec/app42/command/user_token_spec.rb
app42-0.6.4 spec/app42/command/user_token_spec.rb
app42-0.6.3 spec/app42/command/user_token_spec.rb
app42-0.6.2 spec/app42/command/user_token_spec.rb
app42-0.6.1 spec/app42/command/user_token_spec.rb
app42-0.6.0 spec/app42/command/user_token_spec.rb
app42-0.5.10 spec/app42/command/user_token_spec.rb
app42-0.5.9 spec/app42/command/user_token_spec.rb
app42-0.5.8 spec/app42/command/user_token_spec.rb
app42-0.5.7 spec/app42/command/user_token_spec.rb
app42-0.5.6 spec/app42/command/user_token_spec.rb
app42-0.5.5 spec/app42/command/user_token_spec.rb
app42-0.5.4 spec/app42/command/user_token_spec.rb
app42-0.5.3 spec/app42/command/user_token_spec.rb