class Roger::Testing::MockRelease

Creates a mock release object. It is the same as a regular release with the following “presets”

Use MockRelease in testing but never forget to call:

MockRelease#destroy

in teardown otherwise you pollute your filesystem with build directories

Public Class Methods

new(project = nil, config = {}) click to toggle source
Calls superclass method Roger::Release::new
# File lib/roger/testing/mock_release.rb, line 19
def initialize(project = nil, config = {})
  config = {
    scm: :fixed
  }.update(config)

  unless project
    # Create a mock project that's completely empty
    project = MockProject.new
  end

  # Call super to initialize
  super(project, config)
end

Public Instance Methods

destroy() click to toggle source

Destroy will remove all files/directories

# File lib/roger/testing/mock_release.rb, line 34
def destroy
  project.destroy if project.is_a?(MockProject)
end