Sha256: 83af788c96561c6180a977b08ab72296c522c72e2e6138e1101353ad79f5501e

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe Actions::InitializeApplication do
  context '#run' do
    it 'creates all files/directories neccessary to run local_pac' do
      config_string = <<-EOS.strip_heredoc
        :user_file: #{File.join(working_directory, 'config', 'user_file.csv')}
        :config_file: #{File.join(working_directory, 'config', 'config.yaml')}
        :test_cases_directory: #{File.join(working_directory, 'test_cases.d')}
        :examples_directory: #{File.join(working_directory, 'test_cases.d/examples')}
      EOS

      config_file = create_file('config_spec.yaml', config_string)

      config = ProxyTester::Config.new(config_file)

      initializer = Actions::InitializeApplication.new({
          create_user_file: true,
          create_config_file: true,
          create_test_cases_directory: true,
          pre_seed: true
      }, config)

      result = capture(:stdout) do
        silence(:stderr) do
          initializer.run
        end
      end

      expect(path_exists?('config/user_file.csv')).to be_true
      expect(path_exists?('config/config.yaml')).to be_true
      expect(path_exists?('test_cases.d')).to be_true
      expect(path_exists?('test_cases.d/examples/support')).to be_true
      expect(path_exists?('test_cases.d/examples/example_spec.rb')).to be_true
      expect(path_exists?('test_cases.d/examples/spec_helper.rb')).to be_true
      expect(result).to include('config_file:')
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
proxy_tester-0.1.6 spec/actions/initialize_application_spec.rb
proxy_tester-0.1.5 spec/actions/initialize_application_spec.rb
proxy_tester-0.1.4 spec/actions/initialize_application_spec.rb
proxy_tester-0.1.3 spec/actions/initialize_application_spec.rb
proxy_tester-0.1.2 spec/actions/initialize_application_spec.rb
proxy_tester-0.1.1 spec/actions/initialize_application_spec.rb
proxy_tester-0.1.0 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.9 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.8 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.7 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.6 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.5 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.4 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.3 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.2 spec/actions/initialize_application_spec.rb
proxy_tester-0.0.1 spec/actions/initialize_application_spec.rb