Sha256: f864ebd76c6b02af4e8cbcc80743777b2022c2a5248b6a21f4aa1fef05ad4e98

Contents?: true

Size: 992 Bytes

Versions: 6

Compression:

Stored size: 992 Bytes

Contents

class DummyManager
  attr_reader :builder, :scm

  DummyScm = Struct.new(:last_commit_message, :current_revision, :last_author)
  DummyBuilder = Struct.new(:output)

  def initialize(last_commit_message, output, current_revision, last_author)
    @scm = DummyScm.new(last_commit_message, current_revision, last_author)
    @builder = DummyBuilder.new(output)
  end
end

class DummyStatus
  attr_reader :previous_brokeness, :current_brokeness

  def initialize(param)
    @hash = param
    @current_build_successful = @hash['state']
    @previous_build_successful = @hash['previous_build'] || false
    @previous_brokeness = @hash['previous_brokeness'] || ''
    @current_brokeness = @hash['current_brokeness'] || ''
  end

  def current_state
    if @current_build_successful
      if @previous_build_sucessful.nil?
        :setup
      else
        @previous_build_successful ? :successful : :revival
      end
    else
      @previous_build_successful ? :failed : :broken
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cerberus-0.7.6 test/mock/manager.rb
cerberus-0.7.2 test/mock/manager.rb
cerberus-0.7.5 test/mock/manager.rb
cerberus-0.7 test/mock/manager.rb
cerberus-0.5 test/mock/manager.rb
cerberus-0.6 test/mock/manager.rb