wires-test 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wires/test.rb +29 -31
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15428b8ece9da156070bdd4ccac3660bcb0d00cc
|
4
|
+
data.tar.gz: 9de2e85a3d1305e14c77c175a58170e8313b3215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b84d46af4ae7ea5252cb984d7498a21439ec1a12af52d2c6723cd87ad920d5ff5d29a749752238fcde08cb57e4354ca098330c6391c5f1cff9fa5358b809d25
|
7
|
+
data.tar.gz: 298bdec8d279a8c43fd5dd736f972feb2696d29524004ef6b395086009472a4b851445bc37b107c7b7883b4b277c849f81806323e6007b85201e5ea1f29b4016
|
data/lib/wires/test.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
require_relative 'test/minitest'
|
4
|
-
end unless __FILE__=="(eval)"
|
2
|
+
require 'wires/test/minitest'
|
5
3
|
|
6
4
|
|
7
5
|
module Wires
|
@@ -68,37 +66,37 @@ module Wires
|
|
68
66
|
def clear_fired
|
69
67
|
@received_wires_events.clear
|
70
68
|
end
|
69
|
+
end
|
71
70
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
71
|
+
# Build an alternate version of Test for an alternate Wires module
|
72
|
+
# Optionally, specify an affix to be used in method names;
|
73
|
+
# This helps to differentiate from the original Helper
|
74
|
+
def self.build_alt(wires_module_path, affix:nil)
|
75
|
+
affix = affix.to_s if affix
|
76
|
+
|
77
|
+
[__FILE__] # List of files to mutate and eval
|
78
|
+
.map { |file| File.read file }
|
79
|
+
.each do |code|
|
80
|
+
|
81
|
+
code.gsub!(/Wires/, "#{wires_module_path}")
|
82
|
+
|
83
|
+
mutated_names =
|
84
|
+
Helper.instance_methods \
|
85
|
+
- [:before_setup, :after_teardown] \
|
86
|
+
+ [:@received_wires_events]
|
87
|
+
|
88
|
+
mutated_names.each do |meth|
|
89
|
+
meth = meth.to_s
|
90
|
+
sys_meth = meth.gsub /([^_]+)$/, "#{affix}_\\1"
|
91
|
+
code.gsub!(meth, sys_meth)
|
92
|
+
end if affix
|
93
|
+
|
94
|
+
eval code
|
95
|
+
end
|
98
96
|
end
|
99
97
|
|
100
|
-
class Unit < ::Minitest::Unit; include
|
101
|
-
class Spec < ::Minitest::Spec; include
|
98
|
+
class Unit < ::Minitest::Unit; include Helper; end
|
99
|
+
class Spec < ::Minitest::Spec; include Helper; end
|
102
100
|
end
|
103
101
|
|
104
102
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wires-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe McIlvain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wires
|