ss-web_fixtures 0.0.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 +7 -0
- data/lib/web_fixtures/controls/helper.rb +15 -0
- data/lib/web_fixtures/controls.rb +1 -0
- data/lib/web_fixtures/helper.rb +60 -0
- data/lib/web_fixtures.rb +4 -0
- metadata +71 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2790f33489a7af4edcd5a335c6b6c567aad16d988e61c0edfc26c8483129318f
|
|
4
|
+
data.tar.gz: d658bb09f512b6ff0a007fed1cad96cdfe355c329a12830b137e5edd45ffbfcd
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 4e8e16ec4c13c149589f8c888292633bbcad36fd122f1fbb935a7965b1b585dd4c95b75726f62b9f90b70eb5ea5cb7c9f131de8c7313296f0eaf5736f82b3392
|
|
7
|
+
data.tar.gz: 0b1d9cf67ecc6bc27e2c656cc88fc2ab8385be1835039a61d7e534b67581bcae6ddfb29507b246b641cf482629e14fbc8efdef91be423b4160aec8cf7b7a8f8f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "web_fixtures/controls/helper"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module WebFixtures
|
|
2
|
+
class Helper
|
|
3
|
+
Error = Class.new(RuntimeError)
|
|
4
|
+
|
|
5
|
+
include TestBench::Fixture
|
|
6
|
+
include Initializer
|
|
7
|
+
|
|
8
|
+
attr_reader :helper_module
|
|
9
|
+
attr_reader :title_context_name
|
|
10
|
+
attr_reader :test_block
|
|
11
|
+
|
|
12
|
+
def print_title_context?
|
|
13
|
+
if @print_title_context.nil?
|
|
14
|
+
@print_title_context = true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
@print_title_context
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def title_context_name
|
|
21
|
+
if @title_context_name.nil?
|
|
22
|
+
"Helper: #{helper_module}"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
@print_title_context
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.build(helper_module, print_title_context: nil, title_context_name: nil, &test_block)
|
|
29
|
+
new(helper_module, print_title_context, title_context_name, test_block)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
initializer :helper_module, na(:print_title_context), na(:title_context_name), :test_block
|
|
33
|
+
|
|
34
|
+
def call
|
|
35
|
+
if test_block.nil?
|
|
36
|
+
raise Error, "Helper fixture must be actuated with a block"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
if print_title_context?
|
|
40
|
+
context "#{title_context_name}" do
|
|
41
|
+
call!
|
|
42
|
+
end
|
|
43
|
+
else
|
|
44
|
+
call!
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def call!
|
|
49
|
+
helper_module = self.helper_module
|
|
50
|
+
|
|
51
|
+
helper_class = Class.new do
|
|
52
|
+
include helper_module
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
helper = helper_class.new
|
|
56
|
+
|
|
57
|
+
test_block.(helper)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
data/lib/web_fixtures.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ss-web_fixtures
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Ethan Garofolo
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: actionview
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: evt-initializer
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
description: " "
|
|
41
|
+
email: ethan@suchsoftware.com
|
|
42
|
+
executables: []
|
|
43
|
+
extensions: []
|
|
44
|
+
extra_rdoc_files: []
|
|
45
|
+
files:
|
|
46
|
+
- lib/web_fixtures.rb
|
|
47
|
+
- lib/web_fixtures/controls.rb
|
|
48
|
+
- lib/web_fixtures/controls/helper.rb
|
|
49
|
+
- lib/web_fixtures/helper.rb
|
|
50
|
+
homepage: https://gitlab.com/such-software/web-fixtures
|
|
51
|
+
licenses:
|
|
52
|
+
- MIT
|
|
53
|
+
metadata: {}
|
|
54
|
+
rdoc_options: []
|
|
55
|
+
require_paths:
|
|
56
|
+
- lib
|
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 4.0.0
|
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0'
|
|
67
|
+
requirements: []
|
|
68
|
+
rubygems_version: 4.0.16
|
|
69
|
+
specification_version: 4
|
|
70
|
+
summary: ''
|
|
71
|
+
test_files: []
|