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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wires/test.rb +29 -31
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3028d08f961e119349b80c44ab1809c333d95066
4
- data.tar.gz: cb913b720f705ecf252ae37930823b026235c76a
3
+ metadata.gz: 15428b8ece9da156070bdd4ccac3660bcb0d00cc
4
+ data.tar.gz: 9de2e85a3d1305e14c77c175a58170e8313b3215
5
5
  SHA512:
6
- metadata.gz: 2344202069fc523a21a7eb67c125f8a39203c428341b3dcc168472b2dbe6b4420c6eac08596af93ccc0cecb77f86b122db79ab94770e93fa7d2498eb06ddc46e
7
- data.tar.gz: 423b169d738c321b5ef677aae9370c417dcab1a1ff00386f97d8bce70b0ca5857cde357895333feb7b515b22f1eb966c24e199a4cf5eedfbdf96dc7ff1bfb3d9
6
+ metadata.gz: 8b84d46af4ae7ea5252cb984d7498a21439ec1a12af52d2c6723cd87ad920d5ff5d29a749752238fcde08cb57e4354ca098330c6391c5f1cff9fa5358b809d25
7
+ data.tar.gz: 298bdec8d279a8c43fd5dd736f972feb2696d29524004ef6b395086009472a4b851445bc37b107c7b7883b4b277c849f81806323e6007b85201e5ea1f29b4016
data/lib/wires/test.rb CHANGED
@@ -1,7 +1,5 @@
1
1
 
2
- begin
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
- # Build an alternate version of Helper for an alternate Wires module
73
- # Optionally, specify an affix to be used in method names;
74
- # This helps to differentiate from the original Helper
75
- def self.build_alt(wires_module_path, affix:nil)
76
- affix = affix.to_s if affix
77
-
78
- [__FILE__] # List of files to mutate and eval
79
- .map { |file| File.read file }
80
- .each do |code|
81
-
82
- code.gsub!(/Wires/, "#{wires_module_path}")
83
-
84
- mutated_names =
85
- instance_methods \
86
- - [:before_setup, :after_teardown] \
87
- + [:@received_wires_events]
88
-
89
- mutated_names.each do |meth|
90
- meth = meth.to_s
91
- sys_meth = meth.gsub /([^_]+)$/, "#{affix}_\\1"
92
- code.gsub!(meth, sys_meth)
93
- end if affix
94
-
95
- eval code
96
- end
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 Test::Helper; end
101
- class Spec < ::Minitest::Spec; include Test::Helper; end
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.6
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-09-29 00:00:00.000000000 Z
11
+ date: 2013-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wires