Class: GitTest::Test
- Inherits:
-
Object
- Object
- GitTest::Test
- Defined in:
- lib/git_test/test.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#report ⇒ Object
Returns the value of attribute report.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #failed? ⇒ Boolean
- #format ⇒ Object
-
#initialize(options = {}, notify = Notify.new) ⇒ Test
constructor
A new instance of Test.
- #passed? ⇒ Boolean
- #run! ⇒ Object
Constructor Details
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/git_test/test.rb', line 3 def command @command end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/git_test/test.rb', line 3 def created_at @created_at end |
#exit_code ⇒ Object
Returns the value of attribute exit_code.
3 4 5 |
# File 'lib/git_test/test.rb', line 3 def exit_code @exit_code end |
#notify ⇒ Object
Returns the value of attribute notify.
3 4 5 |
# File 'lib/git_test/test.rb', line 3 def notify @notify end |
#report ⇒ Object
Returns the value of attribute report.
3 4 5 |
# File 'lib/git_test/test.rb', line 3 def report @report end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/git_test/test.rb', line 3 def status @status end |
Instance Method Details
#failed? ⇒ Boolean
18 19 20 |
# File 'lib/git_test/test.rb', line 18 def failed? !passed? end |
#format ⇒ Object
10 11 12 |
# File 'lib/git_test/test.rb', line 10 def format :html end |
#passed? ⇒ Boolean
14 15 16 |
# File 'lib/git_test/test.rb', line 14 def passed? exit_code == 0 end |
#run! ⇒ Object
22 23 24 25 26 |
# File 'lib/git_test/test.rb', line 22 def run! self.report = %x{#{command}} self.exit_code = Integer($?) self.status = passed? ? "passed" : "failed" end |