Sha256: 5cd5732f3adea215cfbf1c9eac4a898af75da9fd5107e3121e2b9f08fb5e4bc3

Contents?: true

Size: 712 Bytes

Versions: 1

Compression:

Stored size: 712 Bytes

Contents

# frozen_string_literal: true

module RakeExampleGroup
  extend RSpec::SharedContext

  subject(:task)     { rake[task_name] }

  let(:rake)         { Rake.application }
  let(:task_name)    { self.class.description }
  let(:run_commands) { rake['run_commands'] }
  let(:reset!)       { rake['reset!'] }

  after do
    reset!.invoke
  end

  def load_default_config
    load_config 'default'
  end

  def load_config(config_name)
    Rake.load_rakefile(Dir.pwd + "/spec/configs/#{config_name}.rb")
  end

  def invoke_all(*args)
    task.invoke(*args)
    run_commands.invoke
  end

  def output_file(filename)
    content = File.read("./spec/support/outputs/#{filename}.txt")
    Regexp.new(content)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina-1.2.5 spec/support/rake_example_group.rb