Class: Bob::Test::BuilderStub

Inherits:
Builder
  • Object
show all
Defined in:
lib/bob/test/builder_stub.rb

Instance Attribute Summary collapse

Attributes inherited from Builder

#buildable

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Builder

#build

Constructor Details

#initialize(buildable) ⇒ BuilderStub

Returns a new instance of BuilderStub.



16
17
18
19
20
21
22
# File 'lib/bob/test/builder_stub.rb', line 16

def initialize(buildable)
  super

  @status = nil
  @output = ""
  @commit_info = {}
end

Instance Attribute Details

#commit_infoObject (readonly)

Returns the value of attribute commit_info.



14
15
16
# File 'lib/bob/test/builder_stub.rb', line 14

def commit_info
  @commit_info
end

#outputObject (readonly)

Returns the value of attribute output.



14
15
16
# File 'lib/bob/test/builder_stub.rb', line 14

def output
  @output
end

#statusObject (readonly)

Returns the value of attribute status.



14
15
16
# File 'lib/bob/test/builder_stub.rb', line 14

def status
  @status
end

Class Method Details

.for(repo, commit) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/bob/test/builder_stub.rb', line 4

def self.for(repo, commit)
  new(
    "scm"    => repo.scm,
    "uri"    => repo.uri,
    "branch" => repo.branch,
    "commit" => commit,
    "command" => repo.command
  )
end

Instance Method Details

#completed(status, output) ⇒ Object



28
29
30
31
# File 'lib/bob/test/builder_stub.rb', line 28

def completed(status, output)
  @status = status ? :successful : :failed
  @output = output
end

#started(commit_info) ⇒ Object



24
25
26
# File 'lib/bob/test/builder_stub.rb', line 24

def started(commit_info)
  @commit_info = commit_info
end