delta_test 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +22 -34
- data/Rakefile +5 -2
- data/bin/delta_test +1 -1
- data/circle.yml +5 -1
- data/delta_test.gemspec +1 -1
- data/lib/delta_test/cli/command_base.rb +114 -0
- data/lib/delta_test/cli/exec_command.rb +95 -0
- data/lib/delta_test/cli/help_command.rb +38 -0
- data/lib/delta_test/cli/specs_command.rb +43 -0
- data/lib/delta_test/cli/stats_clean_command.rb +20 -0
- data/lib/delta_test/cli/stats_save_command.rb +67 -0
- data/lib/delta_test/cli/stats_show_command.rb +46 -0
- data/lib/delta_test/cli/version_command.rb +13 -0
- data/lib/delta_test/cli.rb +22 -296
- data/lib/delta_test/configuration.rb +57 -42
- data/lib/delta_test/errors.rb +24 -0
- data/lib/delta_test/generator.rb +4 -24
- data/lib/delta_test/git.rb +161 -80
- data/lib/delta_test/profiler.rb +8 -0
- data/lib/delta_test/related_spec_list.rb +14 -9
- data/lib/delta_test/stats.rb +41 -0
- data/lib/delta_test/version.rb +2 -2
- data/lib/delta_test.rb +14 -9
- data/spec/lib/delta_test/cli/command_base_spec.rb +164 -0
- data/spec/lib/delta_test/cli/exec_command_spec.rb +128 -0
- data/spec/lib/delta_test/cli/help_command_spec.rb +17 -0
- data/spec/lib/delta_test/cli/specs_command_spec.rb +54 -0
- data/spec/lib/delta_test/cli/stats_clean_command_spec.rb +39 -0
- data/spec/lib/delta_test/cli/stats_save_command_spec.rb +207 -0
- data/spec/lib/delta_test/cli/stats_show_command_spec.rb +52 -0
- data/spec/lib/delta_test/cli/version_command_spec.rb +17 -0
- data/spec/lib/delta_test/cli_spec.rb +47 -386
- data/spec/lib/delta_test/configuration_spec.rb +99 -47
- data/spec/lib/delta_test/dependencies_table_spec.rb +1 -1
- data/spec/lib/delta_test/generator_spec.rb +3 -3
- data/spec/lib/delta_test/git_spec.rb +291 -50
- data/spec/lib/delta_test/profiler_spec.rb +3 -3
- data/spec/lib/delta_test/related_spec_list_spec.rb +12 -14
- data/spec/lib/delta_test/stats_spec.rb +89 -0
- data/spec/lib/delta_test/utils_spec.rb +4 -4
- data/spec/lib/delta_test_spec.rb +13 -4
- data/spec/rails/Gemfile.lock +5 -2
- data/spec/rails/app/models/category.rb +4 -0
- data/spec/rails/delta_test.yml +4 -3
- data/spec/rails/spec/models/category_spec.rb +4 -0
- data/spec/spec_helper.rb +9 -2
- data/spec/supports/create_table_file.rb +11 -1
- data/visual.jpg +0 -0
- metadata +32 -4
data/spec/lib/delta_test_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
describe DeltaTest do
|
2
2
|
|
3
|
-
describe '
|
3
|
+
describe '.configure' do
|
4
4
|
|
5
5
|
it 'should change option values inside a block' do
|
6
6
|
expect {
|
@@ -12,7 +12,7 @@ describe DeltaTest do
|
|
12
12
|
|
13
13
|
end
|
14
14
|
|
15
|
-
describe '
|
15
|
+
describe '.active?' do
|
16
16
|
|
17
17
|
context 'Initial' do
|
18
18
|
|
@@ -48,7 +48,7 @@ describe DeltaTest do
|
|
48
48
|
|
49
49
|
end
|
50
50
|
|
51
|
-
describe '
|
51
|
+
describe '.verbose?' do
|
52
52
|
|
53
53
|
context 'Initial' do
|
54
54
|
|
@@ -84,7 +84,7 @@ describe DeltaTest do
|
|
84
84
|
|
85
85
|
end
|
86
86
|
|
87
|
-
describe '
|
87
|
+
describe '.log' do
|
88
88
|
|
89
89
|
context 'In verbose mode' do
|
90
90
|
|
@@ -116,4 +116,13 @@ describe DeltaTest do
|
|
116
116
|
|
117
117
|
end
|
118
118
|
|
119
|
+
describe '.tester_id' do
|
120
|
+
|
121
|
+
it 'should return an unique id for process' do
|
122
|
+
expect(DeltaTest.tester_id).to be_a(String)
|
123
|
+
expect(DeltaTest.tester_id).to match(/\Ap\d+t\d+n\d+\z/)
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
|
119
128
|
end
|
data/spec/rails/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ GIT
|
|
11
11
|
PATH
|
12
12
|
remote: ../..
|
13
13
|
specs:
|
14
|
-
delta_test (
|
14
|
+
delta_test (1.0.0)
|
15
15
|
|
16
16
|
GEM
|
17
17
|
remote: https://rubygems.org/
|
@@ -86,7 +86,7 @@ GEM
|
|
86
86
|
ruby_parser (~> 3.5)
|
87
87
|
i18n (0.7.0)
|
88
88
|
json (1.8.2)
|
89
|
-
libv8 (3.16.14.
|
89
|
+
libv8 (3.16.14.13)
|
90
90
|
loofah (2.0.1)
|
91
91
|
nokogiri (>= 1.5.9)
|
92
92
|
mail (2.6.3)
|
@@ -195,3 +195,6 @@ DEPENDENCIES
|
|
195
195
|
spring
|
196
196
|
sqlite3
|
197
197
|
therubyracer
|
198
|
+
|
199
|
+
BUNDLED WITH
|
200
|
+
1.10.6
|
data/spec/rails/delta_test.yml
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rspec'
|
2
|
+
require 'pry'
|
2
3
|
require 'fakefs/spec_helpers'
|
3
4
|
require 'codeclimate-test-reporter'
|
4
5
|
|
@@ -7,6 +8,8 @@ require 'delta_test'
|
|
7
8
|
Dir["#{File.dirname(__FILE__)}/fixtures/**/*.rb"].each { |f| require f }
|
8
9
|
Dir["#{File.dirname(__FILE__)}/supports/**/*.rb"].each { |f| require f }
|
9
10
|
|
11
|
+
Pry.config.history.should_load = false
|
12
|
+
Pry.config.history.should_save = false
|
10
13
|
|
11
14
|
module DeltaTestSpecHelper
|
12
15
|
|
@@ -25,17 +28,21 @@ RSpec.configure do |config|
|
|
25
28
|
|
26
29
|
config.expect_with :rspec do |expectations|
|
27
30
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
31
|
+
expectations.warn_about_potential_false_positives = false
|
28
32
|
end
|
29
33
|
|
30
34
|
config.mock_with :rspec do |mocks|
|
31
35
|
mocks.verify_partial_doubles = true
|
32
36
|
end
|
33
37
|
|
34
|
-
config.
|
38
|
+
config.before do
|
35
39
|
DeltaTest.active = false
|
36
40
|
DeltaTest.verbose = false
|
37
41
|
|
38
|
-
DeltaTest.
|
42
|
+
allow_any_instance_of(DeltaTest::Git).to receive(:git_repo?).and_return(true)
|
43
|
+
|
44
|
+
allow($stdout).to receive(:puts).with(any_args).and_return(nil)
|
45
|
+
allow($stderr).to receive(:puts).with(any_args).and_return(nil)
|
39
46
|
end
|
40
47
|
|
41
48
|
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
shared_examples :defer_create_table_file do
|
2
2
|
|
3
|
-
let(:
|
3
|
+
let(:stats_path) { '/base_path/stats_path' }
|
4
|
+
let(:tmp_stats_file_path) { [stats_path, 'tmp', DeltaTest.tester_id].join('/') }
|
5
|
+
|
6
|
+
let(:table_file_path) { Pathname.new('/base_path/file_path') }
|
7
|
+
|
8
|
+
let(:tmp_stats_file) do
|
9
|
+
file = FakeFS::FakeFile.new
|
10
|
+
FakeFS::FileSystem.add(tmp_stats_file_path, file)
|
11
|
+
file
|
12
|
+
end
|
4
13
|
|
5
14
|
let(:table_file) do
|
6
15
|
file = FakeFS::FakeFile.new
|
@@ -15,6 +24,7 @@ shared_examples :create_table_file do
|
|
15
24
|
include_examples :defer_create_table_file
|
16
25
|
|
17
26
|
before do
|
27
|
+
tmp_stats_file
|
18
28
|
table_file
|
19
29
|
end
|
20
30
|
|
data/visual.jpg
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delta_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Iwanaga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3.
|
103
|
+
version: '3.4'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '3.
|
110
|
+
version: '3.4'
|
111
111
|
description: delta_test analyzes your tests and runs only related tests for your file
|
112
112
|
changes
|
113
113
|
email:
|
@@ -134,6 +134,14 @@ files:
|
|
134
134
|
- ext/delta_test/extconf.rb
|
135
135
|
- lib/delta_test.rb
|
136
136
|
- lib/delta_test/cli.rb
|
137
|
+
- lib/delta_test/cli/command_base.rb
|
138
|
+
- lib/delta_test/cli/exec_command.rb
|
139
|
+
- lib/delta_test/cli/help_command.rb
|
140
|
+
- lib/delta_test/cli/specs_command.rb
|
141
|
+
- lib/delta_test/cli/stats_clean_command.rb
|
142
|
+
- lib/delta_test/cli/stats_save_command.rb
|
143
|
+
- lib/delta_test/cli/stats_show_command.rb
|
144
|
+
- lib/delta_test/cli/version_command.rb
|
137
145
|
- lib/delta_test/configuration.rb
|
138
146
|
- lib/delta_test/dependencies_table.rb
|
139
147
|
- lib/delta_test/errors.rb
|
@@ -142,11 +150,20 @@ files:
|
|
142
150
|
- lib/delta_test/profiler.rb
|
143
151
|
- lib/delta_test/related_spec_list.rb
|
144
152
|
- lib/delta_test/spec_helpers.rb
|
153
|
+
- lib/delta_test/stats.rb
|
145
154
|
- lib/delta_test/utils.rb
|
146
155
|
- lib/delta_test/version.rb
|
147
156
|
- spec/fixtures/sample/alpha.rb
|
148
157
|
- spec/fixtures/sample/beta.rb
|
149
158
|
- spec/fixtures/sample/gamma.rb
|
159
|
+
- spec/lib/delta_test/cli/command_base_spec.rb
|
160
|
+
- spec/lib/delta_test/cli/exec_command_spec.rb
|
161
|
+
- spec/lib/delta_test/cli/help_command_spec.rb
|
162
|
+
- spec/lib/delta_test/cli/specs_command_spec.rb
|
163
|
+
- spec/lib/delta_test/cli/stats_clean_command_spec.rb
|
164
|
+
- spec/lib/delta_test/cli/stats_save_command_spec.rb
|
165
|
+
- spec/lib/delta_test/cli/stats_show_command_spec.rb
|
166
|
+
- spec/lib/delta_test/cli/version_command_spec.rb
|
150
167
|
- spec/lib/delta_test/cli_spec.rb
|
151
168
|
- spec/lib/delta_test/configuration_spec.rb
|
152
169
|
- spec/lib/delta_test/dependencies_table_spec.rb
|
@@ -155,6 +172,7 @@ files:
|
|
155
172
|
- spec/lib/delta_test/profiler_spec.rb
|
156
173
|
- spec/lib/delta_test/related_spec_list_spec.rb
|
157
174
|
- spec/lib/delta_test/spec_helpers_spec.rb
|
175
|
+
- spec/lib/delta_test/stats_spec.rb
|
158
176
|
- spec/lib/delta_test/utils_spec.rb
|
159
177
|
- spec/lib/delta_test_spec.rb
|
160
178
|
- spec/rails/.gitignore
|
@@ -230,6 +248,7 @@ files:
|
|
230
248
|
- spec/rails/vendor/assets/stylesheets/.keep
|
231
249
|
- spec/spec_helper.rb
|
232
250
|
- spec/supports/create_table_file.rb
|
251
|
+
- visual.jpg
|
233
252
|
homepage: http://github.com/creasty/delta_test
|
234
253
|
licenses:
|
235
254
|
- MIT
|
@@ -258,6 +277,14 @@ test_files:
|
|
258
277
|
- spec/fixtures/sample/alpha.rb
|
259
278
|
- spec/fixtures/sample/beta.rb
|
260
279
|
- spec/fixtures/sample/gamma.rb
|
280
|
+
- spec/lib/delta_test/cli/command_base_spec.rb
|
281
|
+
- spec/lib/delta_test/cli/exec_command_spec.rb
|
282
|
+
- spec/lib/delta_test/cli/help_command_spec.rb
|
283
|
+
- spec/lib/delta_test/cli/specs_command_spec.rb
|
284
|
+
- spec/lib/delta_test/cli/stats_clean_command_spec.rb
|
285
|
+
- spec/lib/delta_test/cli/stats_save_command_spec.rb
|
286
|
+
- spec/lib/delta_test/cli/stats_show_command_spec.rb
|
287
|
+
- spec/lib/delta_test/cli/version_command_spec.rb
|
261
288
|
- spec/lib/delta_test/cli_spec.rb
|
262
289
|
- spec/lib/delta_test/configuration_spec.rb
|
263
290
|
- spec/lib/delta_test/dependencies_table_spec.rb
|
@@ -266,6 +293,7 @@ test_files:
|
|
266
293
|
- spec/lib/delta_test/profiler_spec.rb
|
267
294
|
- spec/lib/delta_test/related_spec_list_spec.rb
|
268
295
|
- spec/lib/delta_test/spec_helpers_spec.rb
|
296
|
+
- spec/lib/delta_test/stats_spec.rb
|
269
297
|
- spec/lib/delta_test/utils_spec.rb
|
270
298
|
- spec/lib/delta_test_spec.rb
|
271
299
|
- spec/rails/.gitignore
|