test_toggler 0.0.1
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 +7 -0
- data/lib/toggler/scenario.rb +43 -0
- data/lib/toggler.rb +9 -0
- metadata +40 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9d03ac0cd8d9a516abd219943fb8ae8ea8df8ca7fd50e9d84412b05f15117e69
|
|
4
|
+
data.tar.gz: 9e9487932eaf428209228308ddeb137229e39811ae2e95c026899aa37353b51b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b05faec4c16c4d9be2076eaf81afd21b55854de51cdb3140a540292657a22ef31abee3ae1545cf3dec6c2b5529ebb36c74d347eb098e44752ea9863b4a448230
|
|
7
|
+
data.tar.gz: 4f1245b9e7fbcb613d409f9d18916b052f4b8164b7126d5f9d6619a8b3a7a5e7225a50822da3e5383f435425f96ea3c5b9ba1abc08e9c4d7b01a8f39cea7fe95
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Toggler
|
|
5
|
+
class Scenario
|
|
6
|
+
extend(T::Sig)
|
|
7
|
+
|
|
8
|
+
ArgsType = T.type_alias { T::Hash[Symbol, T.untyped] }
|
|
9
|
+
ExpectationType = T.type_alias { T.proc.params(result: T.untyped).void }
|
|
10
|
+
TemplateType = T.type_alias { T.proc.params(args: ArgsType).returns(T.untyped) }
|
|
11
|
+
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
default_args: ArgsType,
|
|
15
|
+
template_block: TemplateType,
|
|
16
|
+
).void
|
|
17
|
+
end
|
|
18
|
+
def initialize(default_args:, &template_block)
|
|
19
|
+
@args = default_args
|
|
20
|
+
@template_block = template_block
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
scenario_args: T.untyped,
|
|
26
|
+
).returns(T.self_type)
|
|
27
|
+
end
|
|
28
|
+
def with_args(**scenario_args)
|
|
29
|
+
@args.merge!(scenario_args)
|
|
30
|
+
self
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
assert_block: ExpectationType,
|
|
36
|
+
).void
|
|
37
|
+
end
|
|
38
|
+
def expect(&assert_block)
|
|
39
|
+
result = @template_block[@args]
|
|
40
|
+
assert_block[result]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
data/lib/toggler.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: test_toggler
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Peter Arato
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2025-03-15 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Testing tool to allow quick iteration on variable testing.
|
|
13
|
+
email: it.arato@gmail.com
|
|
14
|
+
executables: []
|
|
15
|
+
extensions: []
|
|
16
|
+
extra_rdoc_files: []
|
|
17
|
+
files:
|
|
18
|
+
- lib/toggler.rb
|
|
19
|
+
- lib/toggler/scenario.rb
|
|
20
|
+
licenses:
|
|
21
|
+
- MIT
|
|
22
|
+
metadata: {}
|
|
23
|
+
rdoc_options: []
|
|
24
|
+
require_paths:
|
|
25
|
+
- lib
|
|
26
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
27
|
+
requirements:
|
|
28
|
+
- - ">="
|
|
29
|
+
- !ruby/object:Gem::Version
|
|
30
|
+
version: '0'
|
|
31
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
32
|
+
requirements:
|
|
33
|
+
- - ">="
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: '0'
|
|
36
|
+
requirements: []
|
|
37
|
+
rubygems_version: 3.6.2
|
|
38
|
+
specification_version: 4
|
|
39
|
+
summary: Test run variator. Not a property tester.
|
|
40
|
+
test_files: []
|