parallel_tests 0.15.4 → 0.16.0

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: d936eb5e0bbc52041661dcc09e82096324828819
4
- data.tar.gz: ff153670996680697c17ffa1603ee2f0da17aa47
3
+ metadata.gz: 1bea638a869699f806b9786a6510463e7a287b8a
4
+ data.tar.gz: 514c300a4d5594db77c111eaa5cc630243d9ee7b
5
5
  SHA512:
6
- metadata.gz: 97baa7391ea76b2092f6652d437d8166653c9938da739977c02e7f4c7857d4cb9ecea5610466c3dbea6952e0b1a8be0c0daf2ef78f801842adec6eddd817fc9d
7
- data.tar.gz: 58dc573cf4b28df8518597a8b7b575506546b789d8cfcff18d08c169d608f941e9dfd64256a4704899fd24680b1bb2314740570c91db20ecad2158896b1e4e33
6
+ metadata.gz: 5b6cf4cc6d47c2f7ba9a0eef1dd1439122862c8dd88a8c5d00ed0439ee9d01e2c59828a3a5c70cbe810b42874db052154cd841271bcab3a78e7bc63ed204f0f9
7
+ data.tar.gz: 8a5f241594d80239f63dd075e5d80dc94cceb1ce2d5315468f17c6362ff7ca5b030d60916b6fd58ec8dabb3e589f923089e466ed5e37af93c9583540a86bea99
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parallel_tests (0.15.4)
4
+ parallel_tests (0.16.0)
5
5
  parallel
6
6
 
7
7
  GEM
@@ -24,7 +24,7 @@ GEM
24
24
  gherkin-ruby (0.3.0)
25
25
  json (1.7.5)
26
26
  json (1.7.5-java)
27
- parallel (0.7.0)
27
+ parallel (0.8.3)
28
28
  rake (10.0.3)
29
29
  rspec (2.13.0)
30
30
  rspec-core (~> 2.13.0)
data/Readme.md CHANGED
@@ -17,14 +17,6 @@ As gem
17
17
  # add to Gemfile
18
18
  gem "parallel_tests", :group => :development
19
19
  ```
20
- OR as plugin
21
-
22
- rails plugin install git://github.com/grosser/parallel_tests.git
23
-
24
- ```ruby
25
- # add to Gemfile
26
- gem "parallel", :group => :development
27
- ```
28
20
 
29
21
  ### Add to `config/database.yml`
30
22
  ParallelTests uses 1 database per test-process.
@@ -294,6 +286,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
294
286
  - [Micah Geisel](https://github.com/botandrose)
295
287
  - [Exoth](https://github.com/Exoth)
296
288
  - [sidfarkus](https://github.com/sidfarkus)
289
+ - [Colin Harris](https://github.com/aberant)
297
290
 
298
291
  [Michael Grosser](http://grosser.it)<br/>
299
292
  michael@grosser.it<br/>
@@ -23,7 +23,7 @@ module ParallelTests
23
23
  end
24
24
 
25
25
  def test_suffix
26
- ".feature"
26
+ /\.feature$/
27
27
  end
28
28
 
29
29
  def line_is_result?(line)
@@ -39,7 +39,7 @@ module ParallelTests
39
39
  end
40
40
 
41
41
  def test_suffix
42
- "_spec.rb"
42
+ /_spec\.rb$/
43
43
  end
44
44
 
45
45
  private
@@ -17,7 +17,7 @@ module ParallelTests
17
17
  end
18
18
 
19
19
  def test_suffix
20
- "_test.rb"
20
+ /_(test|spec).rb$/
21
21
  end
22
22
 
23
23
  def test_file_name
@@ -151,7 +151,7 @@ module ParallelTests
151
151
  (tests || []).map do |file_or_folder|
152
152
  if File.directory?(file_or_folder)
153
153
  files = files_in_folder(file_or_folder, options)
154
- files.grep(/#{Regexp.escape test_suffix}$/).grep(options[:pattern]||//)
154
+ files.grep(test_suffix).grep(options[:pattern]||//)
155
155
  else
156
156
  file_or_folder
157
157
  end
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '0.15.4'
2
+ VERSION = Version = '0.16.0'
3
3
  end
@@ -174,4 +174,18 @@ EOF
174
174
  call(["1 scenario (1 passed)", "1 step (1 passed)"]).should == "1 scenario (1 passed)\n1 step (1 passed)"
175
175
  end
176
176
  end
177
+
178
+ describe ".find_tests" do
179
+ def call(*args)
180
+ ParallelTests::Gherkin::Runner.send(:find_tests, *args)
181
+ end
182
+
183
+ it "doesn't find bakup files with the same name as test files" do
184
+ with_files(['a/x.feature','a/x.feature.bak']) do |root|
185
+ call(["#{root}/"]).should == [
186
+ "#{root}/a/x.feature",
187
+ ]
188
+ end
189
+ end
190
+ end
177
191
  end
@@ -184,4 +184,18 @@ ff.**..
184
184
  call(output).should == ['0 examples, 0 failures, 0 pending','1 examples, 1 failures, 1 pending']
185
185
  end
186
186
  end
187
+
188
+ describe ".find_tests" do
189
+ def call(*args)
190
+ ParallelTests::RSpec::Runner.send(:find_tests, *args)
191
+ end
192
+
193
+ it "doesn't find bakup files with the same name as test files" do
194
+ with_files(['a/x_spec.rb','a/x_spec.rb.bak']) do |root|
195
+ call(["#{root}/"]).should == [
196
+ "#{root}/a/x_spec.rb",
197
+ ]
198
+ end
199
+ end
200
+ end
187
201
  end
@@ -3,6 +3,7 @@ require "parallel_tests/test/runner"
3
3
 
4
4
  describe ParallelTests::Test::Runner do
5
5
  test_tests_in_groups(ParallelTests::Test::Runner, 'test', '_test.rb')
6
+ test_tests_in_groups(ParallelTests::Test::Runner, 'test', '_spec.rb')
6
7
 
7
8
  describe ".run_tests" do
8
9
  def call(*args)
@@ -132,29 +133,6 @@ EOF
132
133
  ParallelTests::Test::Runner.send(:find_tests, *args)
133
134
  end
134
135
 
135
- def with_files(files)
136
- begin
137
- root = "/tmp/test-find_tests-#{rand(999)}"
138
- `mkdir #{root}`
139
- files.each do |file|
140
- parent = "#{root}/#{File.dirname(file)}"
141
- `mkdir -p #{parent}` unless File.exist?(parent)
142
- `touch #{root}/#{file}`
143
- end
144
- yield root
145
- ensure
146
- `rm -rf #{root}`
147
- end
148
- end
149
-
150
- def inside_dir(dir)
151
- old = Dir.pwd
152
- Dir.chdir dir
153
- yield
154
- ensure
155
- Dir.chdir old
156
- end
157
-
158
136
  it "finds test in folders with appended /" do
159
137
  with_files(['b/a_test.rb']) do |root|
160
138
  call(["#{root}/"]).sort.should == [
@@ -210,7 +188,7 @@ EOF
210
188
 
211
189
  it "does not expand paths" do
212
190
  with_files(['a/x_test.rb']) do |root|
213
- inside_dir root do
191
+ Dir.chdir root do
214
192
  call(['a']).sort.should == [
215
193
  "a/x_test.rb"
216
194
  ]
@@ -220,7 +198,7 @@ EOF
220
198
 
221
199
  it "finds test files in folders by pattern" do
222
200
  with_files(['a/x_test.rb','a/y_test.rb','a/z_test.rb']) do |root|
223
- inside_dir root do
201
+ Dir.chdir root do
224
202
  call(["a"], :pattern => /^a\/(y|z)_test/).sort.should == [
225
203
  "a/y_test.rb",
226
204
  "a/z_test.rb",
@@ -229,6 +207,22 @@ EOF
229
207
  end
230
208
  end
231
209
 
210
+ it "doesn't find bakup files with the same name as test files" do
211
+ with_files(['a/x_test.rb','a/x_test.rb.bak']) do |root|
212
+ call(["#{root}/"]).should == [
213
+ "#{root}/a/x_test.rb",
214
+ ]
215
+ end
216
+ end
217
+
218
+ it "finds minispec files" do
219
+ with_files(['a/x_spec.rb']) do |root|
220
+ call(["#{root}/"]).should == [
221
+ "#{root}/a/x_spec.rb",
222
+ ]
223
+ end
224
+ end
225
+
232
226
  it "finds nothing if I pass nothing" do
233
227
  call(nil).should == []
234
228
  end
@@ -155,3 +155,14 @@ def test_tests_in_groups(klass, folder, suffix)
155
155
  end
156
156
  end
157
157
  end
158
+
159
+ def with_files(files)
160
+ Dir.mktmpdir do |root|
161
+ files.each do |file|
162
+ parent = "#{root}/#{File.dirname(file)}"
163
+ `mkdir -p #{parent}` unless File.exist?(parent)
164
+ `touch #{root}/#{file}`
165
+ end
166
+ yield root
167
+ end
168
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.4
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-14 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel