Project

General

Profile

Revision b50ceaa2

Added by Thomas McKay over 6 years ago

fixes #15916 - infrastructure to switch tests to use vcr

Switching to VCR will allow both running against a live server (as the existing tests do now) or to run in pre-recorded mode.

Setting initial code coverage to 26%

Added default rake task to run rubocop and test

View differences:

test/csv_test_helper.rb
16 16
require "minitest-spec-context"
17 17
require "mocha/setup"
18 18

  
19
require './test/test_runner'
20

  
19 21
require 'hammer_cli'
20 22
require 'hammer_cli_foreman/commands'
21 23

  
22
HammerCLI::Settings.load_from_file 'test/config.yml'
24
if File.exists? 'test/config.yml'
25
  HammerCLI::Settings.load_from_file 'test/config.yml'
26
else
27
  HammerCLI::Settings.load({
28
                             :ui => {
29
                               :interactive => true,
30
                               :per_page => 20,
31
                               :history_file => './log/history'
32
                             },
33
                             :watch_plain => true,
34
                             :log_dir => './log',
35
                             :log_level => 'error',
36
                             :log_api_calls => false,
37
                             :log_size => 5,
38
                             :csv => {
39
                               :enable_module => true
40
                             },
41
                             :foreman => {
42
                               :enable_module => true,
43
                               :host => 'https://localhost',
44
                               :username => 'admin',
45
                               :password => 'changeme'
46
                             },
47
                             :katello => {
48
                               :enable_module => true
49
                             }
50
                           })
51
end
23 52

  
53
VCR.insert_cassette("apipie", {})
24 54
require 'hammer_cli_csv'
25 55
require 'hammer_cli_foreman'
26 56
require 'hammer_cli_katello'
57
VCR.eject_cassette
27 58

  
28 59
module HammerCLIForeman
29 60
  def self.clear_credentials

Also available in: Unified diff