testrbl 0.5.1 → 0.5.2

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: e458ead9b53e6251f796655a0ac964fbb7dcd502
4
- data.tar.gz: 48f3f56522194eda329dbc71edff910278d0665f
3
+ metadata.gz: 6512a4285a824c0bb92db42df4dc797a4df84254
4
+ data.tar.gz: 53b3b9c920952bf895f889d937a37d380db6efe4
5
5
  SHA512:
6
- metadata.gz: 4620a107b625dee068843e8e624e0dfbaa0b34cde2f117790088c33b3367a1f1824364f4124b654cd75f9472ba033a98b4d6f4cf03d6aa2cb32da89bc82c44e0
7
- data.tar.gz: be7b74418c4f029cafc36169622291aaa75e427931ac3ee3bf0cae525ebde15fa1cc7989a3181e9b4958aa22eb1a35d4da39d7f2058a932e53ccc0c50ba11cd6
6
+ metadata.gz: a7330868c50baf797bcf4c02e0218240281f20f2d5a16ef477f43f1af5c3170035036da6ecca33a6fad9b75b972cceeae71e394f91ba5bffc8da8575d2d2b5dd
7
+ data.tar.gz: 10729f1d80db2d57a8bf07ad4acb3f1ce67a71723a5118ae1a5bc9afa53e129ae247d5be5ec726a2cd4527bc72ac59ed7f19f1dc2ca079beef601f3beba4ec07
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testrbl (0.5.1)
4
+ testrbl (0.5.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -24,8 +24,13 @@ module Testrbl
24
24
  if files.size == 1 and File.file?(files.first)
25
25
  run(ruby + load_options + files + options)
26
26
  elsif options.none? { |arg| arg =~ /^-n/ }
27
+ seed = if seed = options.index("--seed")
28
+ ["--"] + options.slice!(seed, 2)
29
+ else
30
+ []
31
+ end
27
32
  files = files.map { |f| File.directory?(f) ? all_test_files_in(f) : f }.flatten
28
- run(ruby + load_options + files.map { |f| "-r#{f}" } + options + ["-e", ""])
33
+ run(ruby + load_options + files.map { |f| "-r#{f}" } + options + ["-e", ""] + seed)
29
34
  else # pass though
30
35
  # no bundle exec: projects with mini and unit-test do not run well via bundle exec testrb
31
36
  run ["testrb"] + argv
@@ -1,3 +1,3 @@
1
1
  module Testrbl
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
@@ -1,12 +1,9 @@
1
1
  require 'spec_helper'
2
+ require 'tmpdir'
2
3
 
3
4
  describe Testrbl do
4
5
  around do |example|
5
- run "rm -rf tmp && mkdir tmp"
6
- Dir.chdir "tmp" do
7
- example.call
8
- end
9
- #run "rm -rf tmp"
6
+ Dir.mktmpdir { |dir| Dir.chdir(dir, &example) }
10
7
  end
11
8
 
12
9
  def run(cmd, options={})
@@ -72,6 +69,32 @@ describe Testrbl do
72
69
  end
73
70
  end
74
71
 
72
+ context "--seed" do
73
+ before do
74
+ 2.times do |i|
75
+ write "#{i}_test.rb", <<-RUBY
76
+ require 'minitest/autorun'
77
+
78
+ class Xxx#{i} < Minitest::Test
79
+ def test_xxx
80
+ puts 'ABC'
81
+ end
82
+ end
83
+ RUBY
84
+ end
85
+ end
86
+
87
+ it "seeds a single file" do
88
+ result = testrbl "0_test.rb:6 --seed 1234"
89
+ result.should include "1234"
90
+ end
91
+
92
+ it "seeds multiple files" do
93
+ result = Bundler.with_clean_env { testrbl "0_test.rb 1_test.rb --seed 1234" } # adding --seed triggers minitest to be loaded in a weird way and then the second version is loaded via bundler :/
94
+ result.should include "1234"
95
+ end
96
+ end
97
+
75
98
  context "def test_" do
76
99
  before do
77
100
  write "a_test.rb", <<-RUBY
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrbl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser