mprelude 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 3aacb84586c1ad9f9fc2c511b8d1c9b86fe19ae748963dcf2f0d591783664d0f
4
- data.tar.gz: e029a25a9f97c2130a962a75c9485c5a0ca67df4b7c45f04083dcfadcc15ed2a
3
+ metadata.gz: a2f63ad7edffa0ca7d09d0f162bdf253e34cccf1f182f23360e5e0ee45b76bf8
4
+ data.tar.gz: 680b19d4359642670d74876d44715cfa26f9156317df4275caf761c31501ee68
5
5
  SHA512:
6
- metadata.gz: d94ba246bb06c53482847f1836c23f209f47327b4af22579b0cd253cc5b574b5fd00d7bbf57dee83792db187c41c6db7ecddd8b0b0f3ffe81d3152a4a29ff58e
7
- data.tar.gz: 5dc0fe7dc51a9a6de24c325ed8bef71c079a677e4e7b7dc93f49b631ab954cb553fd84f4ab6e2bc06b25a7046711fa0050c56c0f2f0389334489bd360cb1b506
6
+ metadata.gz: 381d73dae951033421d881ef7114c06c6d33bdbc927c8aa9841eaf18c24061e8eff7528f28e088d904d903764cf6946d4a5fd853bdb82cb122fbd6b61afd47dd
7
+ data.tar.gz: 01a108b78ad032393c9e76ef0f2d988bb47480d1ed7428d138591549fa9e2d450be22c8e3505ac257f0a6ef6eca7870f8c9d17bb8e16098ec8891a1fb107f956
@@ -24,7 +24,7 @@ GIT
24
24
  PATH
25
25
  remote: .
26
26
  specs:
27
- mprelude (0.0.1)
27
+ mprelude (0.0.3)
28
28
  abstract_type (~> 0.0.7)
29
29
  adamantium (~> 0.2.0)
30
30
  concord (~> 0.1.5)
@@ -89,6 +89,20 @@ module MPrelude
89
89
  Left.new(error)
90
90
  end
91
91
 
92
+ # Test for left constructor
93
+ #
94
+ # @return [Boolean]
95
+ def left?
96
+ instance_of?(Left)
97
+ end
98
+
99
+ # Test for right constructor
100
+ #
101
+ # @return [Boolean]
102
+ def right?
103
+ instance_of?(Right)
104
+ end
105
+
92
106
  class Left < self
93
107
  # Evaluate functor block
94
108
  #
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'mprelude'
5
- gem.version = '0.0.2'
5
+ gem.version = '0.0.3'
6
6
  gem.authors = ['Markus Schirp']
7
7
  gem.email = ['mbj@schirp-dso.com']
8
8
  gem.description = 'Minimal prelude alike classes'
@@ -188,6 +188,26 @@ RSpec.describe MPrelude::Either::Left do
188
188
 
189
189
  include_examples '#apply block evaluation'
190
190
  end
191
+
192
+ describe '#left?' do
193
+ def apply
194
+ subject.left?
195
+ end
196
+
197
+ it 'returns true' do
198
+ expect(apply).to be(true)
199
+ end
200
+ end
201
+
202
+ describe '#right?' do
203
+ def apply
204
+ subject.right?
205
+ end
206
+
207
+ it 'returns false' do
208
+ expect(apply).to be(false)
209
+ end
210
+ end
191
211
  end
192
212
 
193
213
  RSpec.describe MPrelude::Either::Right do
@@ -291,4 +311,24 @@ RSpec.describe MPrelude::Either::Right do
291
311
 
292
312
  include_examples '#apply block evaluation'
293
313
  end
314
+
315
+ describe '#left?' do
316
+ def apply
317
+ subject.left?
318
+ end
319
+
320
+ it 'returns false' do
321
+ expect(apply).to be(false)
322
+ end
323
+ end
324
+
325
+ describe '#right?' do
326
+ def apply
327
+ subject.right?
328
+ end
329
+
330
+ it 'returns true' do
331
+ expect(apply).to be(true)
332
+ end
333
+ end
294
334
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mprelude
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2019-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abstract_type