Sha256: 709ccb310ad3f0fbf7b4b30003310e67a922abdbbddb4868d48e50e9fa771486

Contents?: true

Size: 1.34 KB

Versions: 23

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

require 'knapsack_pro'

namespace :knapsack_pro do
  task :encrypted_test_file_names, [:adapter] do |_, args|
    adapter = args[:adapter]

    adapter_class = case adapter
                    when 'rspec'
                      KnapsackPro::Adapters::RSpecAdapter
                    when 'minitest'
                      KnapsackPro::Adapters::MinitestAdapter
                    when 'test_unit'
                      KnapsackPro::Adapters::TestUnitAdapter
                    when 'cucumber'
                      KnapsackPro::Adapters::CucumberAdapter
                    when 'spinach'
                      KnapsackPro::Adapters::SpinachAdapter
                    else
                      raise('Provide adapter name like rspec, minitest, test_unit, cucumber, spinach')
                    end

    test_file_pattern = KnapsackPro::TestFilePattern.call(adapter_class)
    test_files = KnapsackPro::TestFileFinder.call(test_file_pattern)

    test_file_names = []
    test_files.each do |t|
      test_file_names << {
        'path' => t['path'],
        'decrypted_path' => t['path'],
      }
    end

    encrypted_test_files = KnapsackPro::Crypto::Encryptor.new(test_file_names).call

    encrypted_test_files.each do |t|
      puts "path: #{t['decrypted_path']}"
      puts "encrypted path: #{t['path']}"
      puts
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
knapsack_pro-7.13.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.12.1 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.12.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.11.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.10.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.9.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.8.2 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.8.1 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.8.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.7.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.6.2 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.6.1 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.6.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.1.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.0.1 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-7.0.0 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-6.0.4 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-6.0.3 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-6.0.2 lib/tasks/encrypted_test_file_names.rake
knapsack_pro-6.0.1 lib/tasks/encrypted_test_file_names.rake