learn-test 3.2.3 → 3.3.0.pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +27 -0
- data/Gemfile +2 -0
- data/learn-test.gemspec +1 -0
- data/lib/learn_test.rb +15 -34
- data/lib/learn_test/git.rb +19 -0
- data/lib/learn_test/git/wip/base.rb +88 -0
- data/lib/learn_test/git/wip/branch.rb +36 -0
- data/lib/learn_test/git/wip/error.rb +23 -0
- data/lib/learn_test/repo_parser.rb +1 -1
- data/lib/learn_test/reporter.rb +23 -12
- data/lib/learn_test/runner.rb +6 -9
- data/lib/learn_test/strategies/none.rb +5 -5
- data/lib/learn_test/strategy.rb +1 -1
- data/lib/learn_test/version.rb +1 -1
- data/spec/features/rspec_unit_spec.rb +20 -6
- data/spec/fixtures/rspec-unit-spec/.results.json +1 -0
- data/spec/fixtures/rspec-unit-spec/spec/spec_helper.rb +0 -82
- data/spec/learn_test/git/wip/base_spec.rb +89 -0
- data/spec/learn_test/git/wip/branch_spec.rb +121 -0
- data/spec/learn_test/git/wip/error_spec.rb +41 -0
- data/spec/learn_test/git_spec.rb +38 -32
- data/spec/learn_test/reporter_spec.rb +44 -16
- data/spec/lib/learn_test/strategies/none_spec.rb +6 -25
- data/spec/spec_helper.rb +10 -0
- data/spec/support/git.rb +17 -0
- metadata +38 -12
- data/bin/learn-test-wip +0 -249
- data/lib/learn_test/git_wip.rb +0 -34
data/lib/learn_test/git_wip.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'git'
|
4
|
-
require 'logger'
|
5
|
-
|
6
|
-
module LearnTest
|
7
|
-
module GitWip
|
8
|
-
class << self
|
9
|
-
def run!(log: false)
|
10
|
-
git = Git.open('./', log: log)
|
11
|
-
working_branch = git.current_branch
|
12
|
-
|
13
|
-
commands = [
|
14
|
-
'learn-test-wip save "Automatic test submission" --editor',
|
15
|
-
"git push origin wip/#{working_branch}:refs/heads/wip"
|
16
|
-
].join(';')
|
17
|
-
|
18
|
-
Open3.popen3(commands) do |_stdin, _stdout, _stderr, wait_thr|
|
19
|
-
# while out = stdout.gets do; puts out; end
|
20
|
-
# while err = stderr.gets do; puts err; end
|
21
|
-
|
22
|
-
if wait_thr.value.exitstatus.zero?
|
23
|
-
git.config['remote.origin.url'].gsub('.git', '/tree/wip')
|
24
|
-
else
|
25
|
-
# puts 'There was an error running learn-test-wip'
|
26
|
-
false
|
27
|
-
end
|
28
|
-
end
|
29
|
-
rescue StandardError => e
|
30
|
-
false
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|