light-service 0.2.0 → 0.2.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: d6e076aae96c52a5762908422611819327dde2bc
4
- data.tar.gz: 97f23597368c33f4e5fca9d829b286ae73db14d6
3
+ metadata.gz: 075a5390fc8de72c59eb0f3be049cff74a286a48
4
+ data.tar.gz: 7a86920ff7b6e4fe62d9123a3b868741cca216eb
5
5
  SHA512:
6
- metadata.gz: d6aeba0dd3f98960c6e5b13a878018afb5e7f2c6a50b0254dfcadf13b6045c649df51f29c07fd8b023c4f3d075551a6923d63919f3870c2cebc3ce2bf05067ed
7
- data.tar.gz: f9cf3c1bff5df5411bee9240de31192d8a63f42175335905fd5c62d5e1b11d99daf7d824cdd1db8f69348982d17cda18a9a6db77fc3b2d3bbab9f5c73a694a09
6
+ metadata.gz: 3c35a6ce18183266e3df8aaa361b9d5271c95330507e276c0393bfbfea82614b5890d3ed043a3ce64bcd3912cdbb96ef7fe6b5b10d3785e8760ddeb796bff2c6
7
+ data.tar.gz: d2083efec69ab5b70ff3befe6f428ce742e687ab6e6f3ac8c32e7447970905e573cd6741c7f35460dd7842e40ab52b90ad1603a03866dcd1cc959367496590c6
data/README.md CHANGED
@@ -189,9 +189,13 @@ Huge thanks to the [contributors](https://github.com/adomokos/light-service/grap
189
189
 
190
190
  ## Release Notes
191
191
 
192
+ ### 0.2.1
193
+ * [Improving](https://github.com/adomokos/light-service/commit/fc7043241396b4a2556e9664c13c6929f8330025) deprecation warning for the renamed methods
194
+ * Making the message an optional argument for `succeed!` and `fail!` methods
195
+
192
196
  ### 0.2.0
193
- * [Renaming](https://github.com/adomokos/light-service/commit/8d40ff7d393a157a8a558f9e4e021b8731550834) the `set_success!` and `set_failure!` methods to `succeed!` and `fail!`.
194
- * [Throwing](https://github.com/adomokos/light-service/commit/5ef315b8aeeafc99e38676adad3c11df5d93b0e3) an ArgumentError if the `make` method's argument is not Hash or LightService::Context.
197
+ * [Renaming](https://github.com/adomokos/light-service/commit/8d40ff7d393a157a8a558f9e4e021b8731550834) the `set_success!` and `set_failure!` methods to `succeed!` and `fail!`
198
+ * [Throwing](https://github.com/adomokos/light-service/commit/5ef315b8aeeafc99e38676adad3c11df5d93b0e3) an ArgumentError if the `make` method's argument is not Hash or LightService::Context
195
199
 
196
200
  ## License
197
201
 
@@ -46,26 +46,26 @@ module LightService
46
46
  end
47
47
 
48
48
  def set_success!(message)
49
- warn 'DEPRECATED: Please use `succeed!` instead'
49
+ warn '`set_success!` is DEPRECATED: please use `succeed!` instead'
50
50
  succeed!(message)
51
51
  end
52
52
 
53
- def succeed!(message)
53
+ def succeed!(message=nil)
54
54
  @message = message
55
55
  @outcome = ::LightService::Outcomes::SUCCESS
56
56
  end
57
57
 
58
58
  def set_failure!(message)
59
- warn 'DEPRECATED: Please use `fail!` instead'
59
+ warn '`set_failure!` is DEPRECATED: please use `fail!` instead'
60
60
  fail!(message)
61
61
  end
62
62
 
63
- def fail!(message)
63
+ def fail!(message=nil)
64
64
  @message = message
65
65
  @outcome = ::LightService::Outcomes::FAILURE
66
66
  end
67
67
 
68
- def skip_all!(message = nil)
68
+ def skip_all!(message=nil)
69
69
  @message = message
70
70
  @skip_all = true
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module LightService
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -53,12 +53,26 @@ module LightService
53
53
  expect(context).to be_success
54
54
  end
55
55
 
56
+ it "can be pushed into a SUCCESS state without a message" do
57
+ context = Context.make
58
+ context.succeed!
59
+ expect(context).to be_success
60
+ expect(context.message).to be_nil
61
+ end
62
+
56
63
  it "can be pushed into a FAILURE state" do
57
64
  context = Context.make
58
65
  context.fail!("a sad end")
59
66
  expect(context).to be_failure
60
67
  end
61
68
 
69
+ it "can be pushed into a FAILURE state without a message" do
70
+ context = Context.make
71
+ context.fail!
72
+ expect(context).to be_failure
73
+ expect(context.message).to be_nil
74
+ end
75
+
62
76
  it "can set a flag to skip all subsequent actions" do
63
77
  context = Context.make
64
78
  context.skip_all!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: light-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Attila Domokos