sprint 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/sprint.rb +6 -1
- data/test/test_sprint.rb +10 -0
- metadata +1 -1
data/History.txt
CHANGED
data/lib/sprint.rb
CHANGED
@@ -16,10 +16,15 @@ module Sprint
|
|
16
16
|
alias :to_str :to_s
|
17
17
|
|
18
18
|
def good_output
|
19
|
-
|
19
|
+
check
|
20
20
|
@output
|
21
21
|
end
|
22
22
|
|
23
|
+
def check
|
24
|
+
raise "Process exited with error code: #{return_code}" unless success?
|
25
|
+
self
|
26
|
+
end
|
27
|
+
|
23
28
|
def to_i
|
24
29
|
@status.exitstatus
|
25
30
|
end
|
data/test/test_sprint.rb
CHANGED
@@ -40,6 +40,10 @@ class TestSprint < Test::Unit::TestCase
|
|
40
40
|
# an_int = 1 + @results
|
41
41
|
# assert_equal 1, an_int
|
42
42
|
# end
|
43
|
+
|
44
|
+
should "return self on check" do
|
45
|
+
assert_equal @results, @results.check
|
46
|
+
end
|
43
47
|
end
|
44
48
|
|
45
49
|
context "when executing 'false'" do
|
@@ -64,6 +68,12 @@ class TestSprint < Test::Unit::TestCase
|
|
64
68
|
should "have a nonzero status" do
|
65
69
|
assert_not_equal 0, @results.return_code
|
66
70
|
end
|
71
|
+
|
72
|
+
should "raise exception on check" do
|
73
|
+
assert_raise RuntimeError do
|
74
|
+
@results.check
|
75
|
+
end
|
76
|
+
end
|
67
77
|
end
|
68
78
|
end
|
69
79
|
end
|