Sha256: 23c7e45c39f1b6c39847577db1da55840db1e2adde95412a131c3dd38c10db95

Contents?: true

Size: 520 Bytes

Versions: 2

Compression:

Stored size: 520 Bytes

Contents

require 'test_helper'

class Hexlet::MemberCLITest < MiniTest::Test
  def setup
    @router = Hexlet::Router.new
  end

  def test_login
    api_key = "api_key"
    config_file = File.join(Dir.home, ".hexlet", "credentials")

    stub = stub_request(:get, @router.api_member_user_check_url).
      to_return(:status => 200)

    FakeFS do
      result = Hexlet::MemberCLI.start ["login", api_key, "--verbose"]
      assert { result }
      assert { File.file?(config_file) }
    end

    assert_requested stub
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hexlet-0.1.0 test/hexlet/member_cli_test.rb
hexlet-0.0.1 test/hexlet/member_cli_test.rb