learn-test 3.2.3 → 3.2.4

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
  SHA256:
3
- metadata.gz: d7d56bdb688e05fbb81c50ba01c290faff91f67647e04d70e837f2ca444555b1
4
- data.tar.gz: 4d4bf3e106248a1d57408d990ccbd6d0a17c48080db7de8fb971c91a16e557b9
3
+ metadata.gz: 78b850c796efd54f383ea05c625ad8d5f6038d9dcf865b19fc21fd6dcad435fb
4
+ data.tar.gz: 88336d0c6c787c1680b22453220a1046741f7ffaf06d97ce090b7fd4d02d4f25
5
5
  SHA512:
6
- metadata.gz: e73cea00a3e2a7fbafaa01271aeb155de1775b88eb0e8392810bfeae485b8c84d644d8a1d1c70ddb2d3df7df9a79ec7a40dc9d48bf56675ca6bee28551a273c0
7
- data.tar.gz: ea17876778a49cc46a03ba853f39d1edde098f24f57e67606e9f632a5144c1bb94438f810073adad296b7ad4dfc09e750f7dbbcdb630bf5eb5cbec825f23395a
6
+ metadata.gz: ed0abed1a972742bdbd28e05ca20218109f3834267ef560bf884b358e237107f6c294ecbda9248d570fe88c8f4014efb7cdc44bd6779b246acc59d639a35e80c
7
+ data.tar.gz: c36adeff838bf630cc640df29e38f7a82de8e65c5aeff5f20a1c107b93d277c4af07ceb2703306d4306a5295237aec822a1f3105bfebfd7a7d64998be5a69700
@@ -9,7 +9,6 @@ module LearnTest
9
9
  def initialize(repo, options = {})
10
10
  @repo = repo
11
11
  @options = options
12
- die unless strategy
13
12
  end
14
13
 
15
14
  def run
@@ -34,7 +33,11 @@ module LearnTest
34
33
  end
35
34
 
36
35
  def strategy
37
- @strategy ||= strategies.map { |s| s.new(self) }.detect(&:detect)
36
+ return @strategy if @strategy
37
+
38
+ detected = strategies.map { |s| s.new(self) }.detect(&:detect)
39
+
40
+ @strategy = detected || LearnTest::Strategies::None.new(self)
38
41
  end
39
42
 
40
43
  private
@@ -57,8 +60,7 @@ module LearnTest
57
60
  LearnTest::Strategies::Protractor,
58
61
  LearnTest::Strategies::JavaJunit,
59
62
  LearnTest::Strategies::Mocha,
60
- LearnTest::Strategies::Pytest,
61
- LearnTest::Strategies::None
63
+ LearnTest::Strategies::Pytest
62
64
  ]
63
65
  end
64
66
 
@@ -69,10 +71,5 @@ module LearnTest
69
71
  def local_test_run?
70
72
  options.include?('-h') || options.include?('--local')
71
73
  end
72
-
73
- def die
74
- puts "This directory doesn't appear to have any specs in it."
75
- exit
76
- end
77
74
  end
78
75
  end
@@ -7,12 +7,12 @@ module LearnTest
7
7
  '/e/flatiron_none'
8
8
  end
9
9
 
10
- def detect
11
- runner.files.include?('.canvas')
12
- end
13
-
14
10
  def run
15
- puts 'Your assignment was submitted. You can resubmit by running `learn test` again.'
11
+ puts <<~MSG
12
+ This directory doesn't appear to have any specs in it, so there’s no test to run.
13
+
14
+ If you are working on Canvas, this assignment has been submitted. You can resubmit by running `learn test` again.
15
+ MSG
16
16
  end
17
17
 
18
18
  def results
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LearnTest
4
- VERSION = '3.2.3'
4
+ VERSION = '3.2.4'
5
5
  end
@@ -1,33 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe LearnTest::Strategies::None do
4
- describe '#detect' do
5
- context 'there is a .canvas file' do
6
- before { FileUtils.touch('.canvas') }
7
- after { FileUtils.rm('.canvas') }
8
-
9
- it 'is true' do
10
- runner = LearnTest::Runner.new(double(:repo), {})
11
- strategy = LearnTest::Strategies::None.new(runner)
12
-
13
- expect(strategy.detect).to eq(true)
14
- end
15
- end
16
-
17
- context 'there is no .canvas file' do
18
- it 'is false' do
19
- runner = LearnTest::Runner.new(double(:repo), {})
20
- strategy = LearnTest::Strategies::None.new(runner)
21
-
22
- expect(strategy.detect).to eq(false)
23
- end
24
- end
25
- end
26
-
27
4
  describe '#run' do
28
5
  it 'prints a message' do
29
6
  strategy = LearnTest::Strategies::None.new(double(:runner, options: {}))
30
- msg = "Your assignment was submitted. You can resubmit by running `learn test` again.\n"
7
+
8
+ msg = <<~MSG
9
+ This directory doesn't appear to have any specs in it, so there’s no test to run.
10
+
11
+ If you are working on Canvas, this assignment has been submitted. You can resubmit by running `learn test` again.
12
+ MSG
31
13
 
32
14
  expect { strategy.run }.to output(msg).to_stdout
33
15
  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.2.3
4
+ version: 3.2.4
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-09-22 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake