sprint 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +4 -0
  2. data/lib/sprint.rb +6 -1
  3. data/test/test_sprint.rb +10 -0
  4. metadata +1 -1
data/History.txt CHANGED
@@ -13,3 +13,7 @@
13
13
  === 1.0.3 2009-11-11
14
14
 
15
15
  * Fixed String coercion; Sprint::Status now correctly behaves as a String
16
+
17
+ === 1.1.0 2009-11-11
18
+
19
+ * Added Status.check for raising exceptions on failure
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
- raise "Process exited with error code: #{return_code}" unless success?
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Walker