eetee 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09dd13c6b015aa56a24e0ad21532a8d53436c7fd
4
- data.tar.gz: c0570ffaec6070285c59b8b740d371bbc4e3cbab
3
+ metadata.gz: 490ebe9116eabdb5793ae2348327d840d593ba2d
4
+ data.tar.gz: 14f9bd2c7fad97bff8216697b6e430d8a04ad674
5
5
  SHA512:
6
- metadata.gz: 1f4334cd6a783ea34af6f3e577daf4332ffb5dfc7ef0b2c86ce2bf2b7c25c964d4f75ae4fa0b71a6fdbd785fc7c2b4d7fb2c06d384e79d083661853b6ca9f6af
7
- data.tar.gz: 9fca6813fc485d4cb7a4603761a922563f318ee991b474c78355a2beff14755cb4766cbd75806fbff386b2bcfc3293e375e3bfb25bee1107c5bb26a85ae7e058
6
+ metadata.gz: e379722726d5df42376728dbf32160258dc415a5641e1cb254173e93ec72eaf0d26175d4677c72808b451af004afabf254ce1301cec6684b34af59e649b43c1b
7
+ data.tar.gz: 3ee1019f50b7521d4b82fa199d25455e24b39869064b7061debf4001664873684afa9fec5253bbe7c6fe8acecf9bcb068c61f231fc46088ba023486d170645be
@@ -13,23 +13,23 @@ module EEtee
13
13
 
14
14
  end
15
15
 
16
- def raise(error_class = RuntimeError)
16
+ def raise(expected_error_class = RuntimeError)
17
17
  @object.should.be_a ::Proc
18
-
19
18
  err = nil
20
19
  begin
21
- self.call()
20
+ @object.call()
22
21
  rescue => ex
23
22
  err = ex
24
23
  end
25
24
 
26
- fail_message = err ? "#{err.class} (#{err.message})" : "no error"
25
+ error_message = err ? err.message : ""
26
+ fail_message = err ? "#{err.class} (#{error_message})" : "no error"
27
27
 
28
28
  invert_helper(
29
- "expected to raise #{error_class}, got #{fail_message}",
30
- "expected not to raise #{error_class} (#{err.message})"
29
+ "expected to raise #{expected_error_class}, got #{fail_message}",
30
+ "expected not to raise #{expected_error_class} (#{error_message})"
31
31
  ) do
32
- err.class.should == error_class
32
+ err.class.should == expected_error_class
33
33
  end
34
34
 
35
35
  err
data/lib/eetee/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EEtee
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -21,6 +21,7 @@ module Helpers
21
21
  end
22
22
 
23
23
  ret.class.should == error_class
24
+ ret
24
25
  end
25
26
  end
26
27
 
@@ -75,6 +76,15 @@ describe 'AssertionWrapper' do
75
76
  end
76
77
  end
77
78
 
79
+ should 'raise an error if block raises no errors' do
80
+ @obj.expects(:to_zebra).returns(2)
81
+ err = ensure_error_raised(EEtee::AssertionFailed) do
82
+ ->{ @wrapper.to_zebra }.should.raise(ArgumentError)
83
+ end
84
+
85
+ err.message.should == "expected to raise ArgumentError, got no error"
86
+ end
87
+
78
88
  should 'not raise an error if block raises expected error' do
79
89
  @obj.expects(:to_zebra).raises("damn !")
80
90
  ensure_error_not_raised do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eetee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Ammous