composable_operations 0.8.0 → 0.8.1

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: af1c4603f14d42656d794709d5db02bc69014f7b
4
- data.tar.gz: c3b7bcd54b0747b0173f1e01050cb0f1a307247c
3
+ metadata.gz: ed2f5934b48ba2d9abb23788f79669d962491781
4
+ data.tar.gz: 5a8eb0c65e82b61fd3224050d71c7f7ffa937257
5
5
  SHA512:
6
- metadata.gz: 7cd11e937b6183a4b628d02d9b9ade6400a6dd9c831410a6905ab21e06d88db3b17117e8a06261e6064119f092b760f66053db87d8d2c8294eb5e6af31915e64
7
- data.tar.gz: 6647e6ba14819d2d6fe07d339ac5290d449038ed2096f33f8c1ea64903202379adb1acd707586332b6c2c809c2d8bdbfe05cff3bbf9f33cbdde232dba05027a8
6
+ metadata.gz: e770c5c3058e3e7936a8ed325fd3501614d88d6415379bd375dfc1d26b0d8b1efa99a0dad28d0d2b990b3ffa74aff4a2764db81b90dbcf9d6370ab878b6350ec
7
+ data.tar.gz: 551575ffb3d2a35214b9d3250f8498a65cb8983bbfdbfd3bbfd91874b1e79c30e9083fe6c8e4b6de0e40897b5b19e14880e83bdf4bbe64bccf58279082aab266
@@ -43,7 +43,7 @@ module ComposableOperations
43
43
  end
44
44
 
45
45
  def exception
46
- @exception or defined?(super) ? super : OperationError
46
+ OperationError
47
47
  end
48
48
 
49
49
  protected
@@ -70,7 +70,7 @@ module ComposableOperations
70
70
  end
71
71
 
72
72
  def raises(exception)
73
- @exception = exception
73
+ define_singleton_method(:exception) { exception }
74
74
  end
75
75
 
76
76
  private
@@ -1,3 +1,3 @@
1
1
  module ComposableOperations
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -87,6 +87,17 @@ describe ComposableOperations::Operation, "that always fails:" do
87
87
  failing_operation_with_custom_default_exception_instance.exception.message.should be == 'Operation failed'
88
88
  end
89
89
  end
90
+
91
+ context "when subclassed" do
92
+ subject(:failing_operation_with_custom_default_exception_subclass) do
93
+ Class.new(failing_operation_with_custom_default_exception)
94
+ end
95
+
96
+ it "should raise the custom exception when executed" do
97
+ expect { failing_operation_with_custom_default_exception_subclass.perform }.
98
+ to raise_error(custom_exception, "Operation failed")
99
+ end
100
+ end
90
101
  end
91
102
 
92
103
  context "When a custom exception has been specified" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composable_operations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Tennhard