rubeno 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 381193b77499b6d76a5fbc4b8961903a5f5f6165acabff0d14d4ac90f5dd592e
4
- data.tar.gz: d9c769082f34378bb7c383b81e8825b59718992a3fe9eeeda3716cd199fa48b6
3
+ metadata.gz: b87152f22a7f6d6524f84cf09bdbb3b694e34934bfe2c592f54d5a08cd274fe9
4
+ data.tar.gz: 7b43a128aabff272b9c64e243c6e2309aa72cf60c717fe78ab31a3ea30a7072e
5
5
  SHA512:
6
- metadata.gz: b9db60ef99dd7f9b8e5d3b6df922a5e8eaab58020fe49f0bf721382be2a55b6043de1a567e22ed0fa8890b6727e060662685bb72e1244a6bcd73665d91d77684
7
- data.tar.gz: 9dd4c1fdfd7ce1674b8d9104f12eacfe3b9fdc74fb62f2a64a9ada2eaf27c91bca0a2a3dde3aa72b12d36ed3cd2b20a80eb8c6003a97295bec5159878e063a8b
6
+ metadata.gz: '0343584b6e498d7fc0c14ca7fb86da59ecb3fea98178acf7453e71783cdff1d7460883c9df7d0b10424a967b7c97ab76372603f2c16a9be293598f6a891ad321'
7
+ data.tar.gz: 0256ef592a012bf33589b7b368ce16b3af182ae5e2629ece42fc70f33e53d7b8a7b85b5fefe848cb4f5b21d7f0a43813a46ac13863c4ecad0b924fefc1f79912
data/lib/base_given.rb CHANGED
@@ -3,12 +3,13 @@ module Rubeno
3
3
  attr_accessor :features, :whens, :thens, :error, :fail, :store, :recommended_fs_path,
4
4
  :given_cb, :initial_values, :key, :failed, :artifacts, :status, :fails
5
5
 
6
- def initialize(features, whens, thens, given_cb, initial_values)
6
+ def initialize(features, whens, thens, given_cb, initial_values, adapter = nil)
7
7
  @features = features
8
8
  @whens = whens
9
9
  @thens = thens
10
10
  @given_cb = given_cb
11
11
  @initial_values = initial_values
12
+ @adapter = adapter
12
13
  @artifacts = []
13
14
  @fails = 0
14
15
  end
@@ -36,7 +37,13 @@ module Rubeno
36
37
  end
37
38
 
38
39
  def given_that(subject, test_resource_configuration, artifactory, given_cb, initial_values, pm)
39
- raise NotImplementedError, "given_that must be implemented by subclasses"
40
+ # Use the adapter's before_each method if available
41
+ if @adapter
42
+ @adapter.before_each(subject, given_cb, test_resource_configuration, initial_values, pm)
43
+ else
44
+ # Fallback to just returning the subject
45
+ subject
46
+ end
40
47
  end
41
48
 
42
49
  def after_each(store, key, artifactory, pm)
data/lib/base_then.rb CHANGED
@@ -15,7 +15,8 @@ module Rubeno
15
15
  end
16
16
 
17
17
  def but_then(store, then_cb, test_resource_configuration, pm)
18
- raise NotImplementedError, "but_then must be implemented by subclasses"
18
+ # Call the then_cb directly
19
+ then_cb.call(store)
19
20
  end
20
21
 
21
22
  def to_obj
data/lib/base_when.rb CHANGED
@@ -14,7 +14,8 @@ module Rubeno
14
14
  end
15
15
 
16
16
  def and_when(store, when_cb, test_resource_configuration, pm)
17
- raise NotImplementedError, "and_when must be implemented by subclasses"
17
+ # Call the when_cb directly
18
+ when_cb.call(store)
18
19
  end
19
20
 
20
21
  def to_obj
data/lib/rubeno.rb CHANGED
@@ -99,7 +99,7 @@ module Rubeno
99
99
  # Create classy givens
100
100
  test_implementation.givens.each do |key, given_cb|
101
101
  @given_overrides[key] = ->(features, whens, thens, initial_values = nil) do
102
- BaseGiven.new(features, whens, thens, given_cb, initial_values)
102
+ BaseGiven.new(features, whens, thens, given_cb, initial_values, @test_adapter)
103
103
  end
104
104
  end
105
105
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubeno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wong