sus 0.15.3 → 0.16.0

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: ca4fbc032d65ca7f24a8c551f9202722aa81d90ec15cf40e73dd05ecbe9a5bf8
4
- data.tar.gz: 937cf3c24714895dc13d81750399cbff7adddc4969eca4e096b2927cbd6e08bb
3
+ metadata.gz: f36ad4203b1471b0dfa6a95fd4407978f5bfab703c09d14d2ee481d519296b46
4
+ data.tar.gz: 539e6eb3ef50f12d6159c271a63130e696c3f48f914e1b74e7671a90cf90f726
5
5
  SHA512:
6
- metadata.gz: 0c9864a40e6fba7866856f86616f93e7b87579e07d2759a9c19c8ef3f6a31971506a0861c0f179c688c32ad5d5c7f28c8fe1f9b33f30c3dd576ef4622fd306a0
7
- data.tar.gz: f8fc4848f66ef8ea3d52ffd3d8d4918e14bc464f5e30ee8fba66f1bfcf584c2ce1eb8e37679f96b93bd15600551f142f23f38cccff23df9ac9bceb4ac20e5134
6
+ metadata.gz: dddf727776b219c29970aea30f177903bd52f82497a552dd55ff4821be51b5722aade3e081b3eb0d878ab033385ef375aee222afbf500b07a109b2bc8438f85f
7
+ data.tar.gz: 9dd5df66341eaac3877777af106cd2262720991a3ec742b7859934790255440334b961bce01a3b28306e45b7c4db33d56f56cc5bdf052143f4109a4854f3ba8e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -11,7 +11,7 @@ module Sus
11
11
 
12
12
  attr_accessor :shared
13
13
 
14
- def self.build(parent, shared, unique: false, &block)
14
+ def self.build(parent, shared, arguments = nil, unique: false, &block)
15
15
  base = Class.new(parent)
16
16
  base.singleton_class.prepend(ItBehavesLike)
17
17
  base.children = Hash.new
@@ -20,10 +20,10 @@ module Sus
20
20
 
21
21
  # User provided block is evaluated first, so that it can provide default behaviour for the shared context:
22
22
  if block_given?
23
- base.class_exec(&block)
23
+ base.class_exec(*arguments, &block)
24
24
  end
25
25
 
26
- base.class_exec(&shared.block)
26
+ base.class_exec(*arguments, &shared.block)
27
27
  return base
28
28
  end
29
29
 
@@ -34,8 +34,8 @@ module Sus
34
34
  end
35
35
 
36
36
  module Context
37
- def it_behaves_like(shared, **options, &block)
38
- add ItBehavesLike.build(self, shared, **options, &block)
37
+ def it_behaves_like(shared, *arguments, **options, &block)
38
+ add ItBehavesLike.build(self, shared, arguments, **options, &block)
39
39
  end
40
40
  end
41
41
  end
data/lib/sus/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2022, by Samuel Williams.
5
5
 
6
6
  module Sus
7
- VERSION = "0.15.3"
7
+ VERSION = "0.16.0"
8
8
  end
data/lib/sus/with.rb CHANGED
@@ -21,6 +21,8 @@ module Sus
21
21
  base.identity = Identity.nested(parent.identity, base.description, unique: unique)
22
22
  base.variables = variables
23
23
 
24
+ base.define_method(:description, ->{subject})
25
+
24
26
  variables.each do |key, value|
25
27
  base.define_method(key, ->{value})
26
28
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2023-01-02 00:00:00.000000000 Z
41
+ date: 2023-01-03 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: bake-test
metadata.gz.sig CHANGED
Binary file