learn-test 3.3.0.pre.1 → 3.3.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/learn_test/git/wip/base.rb +1 -1
- data/lib/learn_test/git/wip/branch.rb +2 -2
- data/lib/learn_test/version.rb +1 -1
- data/spec/features/rspec_unit_spec.rb +4 -3
- data/spec/learn_test/git/wip/base_spec.rb +5 -5
- data/spec/learn_test/reporter_spec.rb +14 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/support/git.rb +17 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34479d2b40afafa001626db60d17a0f80273293a0d70817fc46b3c91e01f8b81
|
4
|
+
data.tar.gz: 6423442bb278878a96673d8769a81eaa01bbcd56b12a1080b3e696298bb06f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eedc292d447fcc1732ae73457fae8c1c574db19ddeeea0cd1a42a527d879c4757bd951a2b47af8e1b2913714d74cf5e955ebcb0b8605eb2f4beb3b50fac5a602
|
7
|
+
data.tar.gz: d87fdc06850600e77021ac6891122a14a5c69bea2af562304b4d2c9e0345ea56823871f3a0b7f7e64077ee67873fc717662633562575ad6d2af734b75ca21ab1
|
@@ -45,7 +45,7 @@ module LearnTest
|
|
45
45
|
@base.diff(new_tree, @wip_branch.parent)
|
46
46
|
|
47
47
|
# tree_diff = @base.diff(new_tree, @wip_branch.parent)
|
48
|
-
# raise NoChangesError, @wip_branch if tree_diff.count.zero?
|
48
|
+
# raise LearnTest::Git::Wip::NoChangesError, @wip_branch if tree_diff.count.zero?
|
49
49
|
|
50
50
|
commit = @base.commit_tree(new_tree, parent: @wip_branch.parent)
|
51
51
|
|
@@ -17,10 +17,10 @@ module LearnTest
|
|
17
17
|
@base.revparse(@name)
|
18
18
|
rescue ::Git::GitExecuteError => e
|
19
19
|
if raise_no_commits
|
20
|
-
raise e.message.match(NoCommitsError::REGEX) ? NoCommitsError.new(@name) : e
|
20
|
+
raise e.message.match(LearnTest::Git::Wip::NoCommitsError::REGEX) ? LearnTest::Git::Wip::NoCommitsError.new(@name) : e
|
21
21
|
end
|
22
22
|
|
23
|
-
raise unless e.message.match(NoCommitsError::REGEX)
|
23
|
+
raise unless e.message.match(LearnTest::Git::Wip::NoCommitsError::REGEX)
|
24
24
|
|
25
25
|
false
|
26
26
|
end
|
data/lib/learn_test/version.rb
CHANGED
@@ -12,9 +12,10 @@ describe 'Running a RSpec Unit Test', type: :aruba do
|
|
12
12
|
before :each do
|
13
13
|
copy '%/rspec-unit-spec', 'example'
|
14
14
|
cd 'example'
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
|
16
|
+
git_init
|
17
|
+
git_add
|
18
|
+
git_commit 'Initial Commit'
|
18
19
|
end
|
19
20
|
|
20
21
|
def run(flags = '')
|
@@ -31,11 +31,11 @@ describe LearnTest::Git::Wip::Base do
|
|
31
31
|
create_directory 'example'
|
32
32
|
cd 'example'
|
33
33
|
write_file 'README.md', 'Hello World'
|
34
|
-
|
34
|
+
git_init
|
35
35
|
|
36
36
|
if commit # rubocop:disable Style/GuardClause
|
37
|
-
|
38
|
-
|
37
|
+
git_add
|
38
|
+
git_commit 'Initial Commit'
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -74,8 +74,8 @@ describe LearnTest::Git::Wip::Base do
|
|
74
74
|
initialize_repo
|
75
75
|
write_file 'test.rb', ''
|
76
76
|
|
77
|
-
|
78
|
-
|
77
|
+
git_add
|
78
|
+
git_commit 'foo'
|
79
79
|
end
|
80
80
|
|
81
81
|
it 'should process successfully' do
|
@@ -96,6 +96,20 @@ describe LearnTest::Reporter do
|
|
96
96
|
end
|
97
97
|
|
98
98
|
it 'posts results to the service endpoint' do
|
99
|
+
branch = double(LearnTest::Git::Wip::Branch)
|
100
|
+
branch_name = 'bar'
|
101
|
+
|
102
|
+
expect(LearnTest::Git).to receive(:open).and_return(git_base)
|
103
|
+
expect(git_base).to receive(:wip).and_return(git_wip)
|
104
|
+
expect(git_wip).to receive(:success?).and_return(true)
|
105
|
+
|
106
|
+
expect(branch).to receive(:to_s).and_return(branch_name)
|
107
|
+
expect(git_wip).to receive(:wip_branch).and_return(branch)
|
108
|
+
|
109
|
+
expect(git_base)
|
110
|
+
.to receive(:push)
|
111
|
+
.with('origin', "#{branch_name}:refs/heads/fis-wip", { force: true })
|
112
|
+
|
99
113
|
reporter.report
|
100
114
|
|
101
115
|
expect(client).to have_received(:post_results)
|
data/spec/spec_helper.rb
CHANGED
@@ -8,6 +8,9 @@ SimpleCov.start
|
|
8
8
|
|
9
9
|
require_relative '../lib/learn_test'
|
10
10
|
|
11
|
+
support_dir = File.join('./', 'spec', 'support', '**', '*.rb')
|
12
|
+
Dir.glob(support_dir).each { |f| require f }
|
13
|
+
|
11
14
|
RSpec.configure do |config|
|
12
15
|
config.expect_with :rspec do |expectations|
|
13
16
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
data/spec/support/git.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
def git_set_user
|
2
|
+
run_command_and_stop 'git config user.email "info@flatironschool.com"'
|
3
|
+
run_command_and_stop 'git config user.name "Flatiron School"'
|
4
|
+
end
|
5
|
+
|
6
|
+
def git_init
|
7
|
+
run_command_and_stop 'git init'
|
8
|
+
git_set_user
|
9
|
+
end
|
10
|
+
|
11
|
+
def git_add(files = '.')
|
12
|
+
run_command_and_stop "git add #{files}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def git_commit(msg)
|
16
|
+
run_command_and_stop "git commit -m \"#{msg}\""
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: learn-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.0.pre.
|
4
|
+
version: 3.3.0.pre.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flatiron School
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -228,6 +228,7 @@ files:
|
|
228
228
|
- spec/lib/learn_test/strategies/none_spec.rb
|
229
229
|
- spec/repo_parser_spec.rb
|
230
230
|
- spec/spec_helper.rb
|
231
|
+
- spec/support/git.rb
|
231
232
|
homepage: https://github.com/learn-co/learn-test
|
232
233
|
licenses:
|
233
234
|
- MIT
|
@@ -271,3 +272,4 @@ test_files:
|
|
271
272
|
- spec/lib/learn_test/strategies/none_spec.rb
|
272
273
|
- spec/repo_parser_spec.rb
|
273
274
|
- spec/spec_helper.rb
|
275
|
+
- spec/support/git.rb
|