maxitest 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47e4e8c1118a42c34537b3aa1d3c3a03d7fb4ac8
4
- data.tar.gz: f10d6c4574c51d8054aae4990e94dc56bdcb5608
3
+ metadata.gz: 7ada2fcaf0961ecb335010364d543e9f3a74889b
4
+ data.tar.gz: cafe5159aa98f17961764b70c4c31ade8399acd2
5
5
  SHA512:
6
- metadata.gz: db27da82a1b353c7680dd2766cb4294d3621a5121cafe7824b741e3ce7d300c842171f5a24a2af7e7e1171755cdbb3db8649d3b050182e7a22f4f9ad4e8749a2
7
- data.tar.gz: 6ef77808461bf012f80dcb848bccdd2bc260bfca13a493cad7a2cb388855f0e639534e41c1a481e3cdf1ba765abcccc4f8833057170515d46ca4d1805e2e4e3b
6
+ metadata.gz: c4bcb5740bd548b89314344a0a4049956c762a69a8bc6739d7e5b5957cfb2ff806f1b5333d61cc8289afebebfe2debb3ffbb599316c62c714e26cd7f9c246c3a
7
+ data.tar.gz: abecf17870b29c8303fdd42548c6898a29b65f68aa8ac0c1ffd68fb823ac3f9042fe9991f3b2aae7c877ac56cb08707a593f66c80a96f02e066859101cdf092e
@@ -29,7 +29,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
29
  # https://raw.githubusercontent.com/splattael/minitest-around/master/lib/minitest/around/version.rb
30
30
  # BEGIN generated by rake update, do not modify
31
31
  module MinitestAround
32
- VERSION = '0.3.0'
32
+ VERSION = '0.3.1'
33
33
  end
34
34
  #END generated by rake update, do not modify
35
35
 
@@ -148,18 +148,17 @@ module Maxitest
148
148
  def self.test_pattern_from_match(method, test_name)
149
149
  regex = Regexp.escape(test_name).gsub("\\ "," ").gsub(INTERPOLATION, ".*")
150
150
 
151
- regex = case method
152
- when "should"
153
- optional_test_name = "(?:\(.*\))?"
154
- "#{method} #{regex}\. #{optional_test_name}$"
155
- when "describe"
156
- "#{test_name}(::)?"
157
- when "test"
151
+ regex = if method == "test"
158
152
  # test "xxx -_ yyy"
159
153
  # test-unit: "test: xxx -_ yyy"
160
154
  # activesupport: "test_xxx_-__yyy"
161
155
  "^test(: |_)#{regex.gsub(" ", ".")}$"
162
- when "it"
156
+ elsif method == "describe" || (method == "context" && !via_shoulda?)
157
+ "#{test_name}(::)?"
158
+ elsif method == "should" && via_shoulda?
159
+ optional_test_name = "(?:\(.*\))?"
160
+ "#{method} #{regex}\. #{optional_test_name}$"
161
+ elsif ["it", "should"].include?(method) # minitest aliases for shoulda
163
162
  "#test_\\d+_#{test_name}$"
164
163
  else
165
164
  regex
@@ -167,6 +166,11 @@ module Maxitest
167
166
 
168
167
  regex.gsub("'", ".")
169
168
  end
169
+
170
+ def self.via_shoulda?
171
+ return @via_shoulda if defined?(@via_shoulda)
172
+ @via_shoulda = !File.exist?("Gemfile.lock") || File.read("Gemfile.lock").include?(" shoulda-context ")
173
+ end
170
174
  end
171
175
  end
172
176
  #END generated by rake update, do not modify
@@ -1,3 +1,3 @@
1
1
  module Maxitest
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-26 00:00:00.000000000 Z
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest