Sha256: 046848ec234e3c5a468e69061827c6785b03be6768c525f96f5132b7dcf580c5

Contents?: true

Size: 746 Bytes

Versions: 4

Compression:

Stored size: 746 Bytes

Contents

require 'rspec/core/rake_task'
require 'pathname'

# TODO: generate comprehensive transform specs if possible
namespace :spec do
  specs_dir = File.expand_path('../spec', __dir__)
  generated_specs_dir = 'generated'

  desc "regenerates spec/#{generated_specs_dir} from MARCSpec-Test-Suite"
  task :generate do
    require_relative 'parser_specs'

    in_dir = File.join(specs_dir, 'suite')
    out_dir = File.join(specs_dir, generated_specs_dir)

    ParserSpecs::Rule.all_from_json(in_dir).each do |rule|
      rule.write_rspec_to(out_dir)
    end

    RuboCop::CLI.new.run([out_dir])
  end
end

RSpec::Core::RakeTask.new do |task|
  task.rspec_opts = %w[--color --format documentation --order default]
  task.pattern = 'spec/**/*_spec.rb'
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-marc-spec-0.1.3 rakelib/spec.rake
ruby-marc-spec-0.1.2 rakelib/spec.rake
ruby-marc-spec-0.1.1 rakelib/spec.rake
ruby-marc-spec-0.1.0 rakelib/spec.rake