learn-test 1.2.22 → 1.2.23

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: b750248ec1419c5bde148b4491e4b73825029dfc
4
- data.tar.gz: dfeccbf8ccbab5551e84ebde7d5ff49aadacec85
3
+ metadata.gz: 382ed4a3f59b801020ce6c917bf776d45a8bfc03
4
+ data.tar.gz: 0ab9f2fc5238b6c29311103fc46cfc5a17673dc6
5
5
  SHA512:
6
- metadata.gz: f6cf3e0bc9b8f4d8b3eae972b6070f6147c1480d0b1e84d937f29b9823dabd1e7219b3d8ac2b1a07067d8b66cce4b74a243ec874f4e1dd9a3c7f9574d0cc8b88
7
- data.tar.gz: 9fb15f5cf7ab972d02e47f48e1e83932ca160cfe91feea7eae74aa497b31b53b21258d7de4fe40414e40338562e69e5132f3d73fa765ecd046824551a5c5f4dd
6
+ metadata.gz: 6a93db12f8ab4906ee4ea38a37c280670217d679ed28877c969992ced2812d25d8f9be0e53ceef80ae83451a641aab7ca182004058154ac122f32ab02fcbbcca
7
+ data.tar.gz: 4fca55b40207b46dda23f69b2997132bd977e428b9c99b8580e2684294312487c530feb49f0ae32255ea122a25b4f287417690828a16d2989bfa493bb95d50df
data/bin/learn-test CHANGED
@@ -44,6 +44,10 @@ if spec_type == "jasmine"
44
44
  opts.on("-t", "--test") do |t|
45
45
  options[:test] = t
46
46
  end
47
+
48
+ opts.on('--keep', "Don't delete test output files") do |k|
49
+ options[:keep] = true
50
+ end
47
51
  end.parse!
48
52
 
49
53
  if ARGV.any? { |arg| arg == "init" }
@@ -6,7 +6,7 @@ require 'json'
6
6
  module LearnTest
7
7
  module Jasmine
8
8
  class Runner
9
- attr_reader :no_color, :local, :browser, :conn, :color_opt, :out
9
+ attr_reader :no_color, :local, :browser, :conn, :color_opt, :out, :keep_results
10
10
  attr_accessor :json_results
11
11
 
12
12
  def self.run(username, user_id, repo_name, options)
@@ -20,6 +20,7 @@ module LearnTest
20
20
  @local = !!options[:local]
21
21
  @browser = !!options[:browser]
22
22
  @out = options[:out]
23
+ @keep_results = options[:keep]
23
24
  @json_results = {
24
25
  username: username,
25
26
  github_user_id:user_id,
@@ -73,8 +74,9 @@ module LearnTest
73
74
  set_passing_test_count
74
75
  end
75
76
 
76
- if out
77
- write_json_output
77
+ if out || keep_results
78
+ output_file = out ? out : '.results.json'
79
+ write_json_output(output_file: output_file)
78
80
  end
79
81
  end
80
82
 
@@ -82,8 +84,8 @@ module LearnTest
82
84
  json_results[:passing_count] = json_results[:tests] - json_results[:failures] - json_results[:errors]
83
85
  end
84
86
 
85
- def write_json_output
86
- File.open(out, 'w+') do |f|
87
+ def write_json_output(output_file:)
88
+ File.open(output_file, 'w+') do |f|
87
89
  f.write(json_results.to_json)
88
90
  end
89
91
  end
@@ -126,4 +128,3 @@ module LearnTest
126
128
  end
127
129
  end
128
130
  end
129
-
@@ -2,7 +2,7 @@ module LearnTest
2
2
  module PythonUnittest
3
3
  class Runner
4
4
  attr_accessor :parsed_output, :json_output, :formatted_results
5
- attr_reader :username, :user_id, :repo_name, :options, :connection
5
+ attr_reader :username, :user_id, :repo_name, :options, :connection, :keep_results
6
6
 
7
7
  def initialize(username, user_id, repo_name, options)
8
8
  @username = username
@@ -12,6 +12,7 @@ module LearnTest
12
12
  @json_output = ""
13
13
  @parsed_output = nil
14
14
  @formatted_results = {}
15
+ @keep_results = !!options.delete('--keep')
15
16
  @connection = Faraday.new(url: SERVICE_URL) do |faraday|
16
17
  faraday.adapter Faraday.default_adapter
17
18
  end
@@ -28,6 +29,10 @@ module LearnTest
28
29
  end
29
30
  end
30
31
 
32
+ def keep_results?
33
+ keep_results
34
+ end
35
+
31
36
  def run_nose
32
37
  system("nosetests #{options.join(' ')} --verbose --with-json --json-file='./.results.json'")
33
38
  end
@@ -81,7 +86,7 @@ module LearnTest
81
86
  end
82
87
 
83
88
  def cleanup
84
- FileUtils.rm('.results.json')
89
+ FileUtils.rm('.results.json') unless keep_results?
85
90
  end
86
91
  end
87
92
  end
@@ -1,7 +1,7 @@
1
1
  module LearnTest
2
2
  module RSpec
3
3
  class Runner
4
- attr_accessor :parsed_output, :json_output, :formatted_results
4
+ attr_accessor :parsed_output, :json_output, :formatted_results, :keep_results
5
5
  attr_reader :username, :user_id, :repo_name, :options, :connection
6
6
 
7
7
  def initialize(username, user_id, repo_name, options)
@@ -52,6 +52,8 @@ module LearnTest
52
52
  options.delete("-t")
53
53
  options.delete("-l")
54
54
  options.delete("--local")
55
+
56
+ self.keep_results = !!options.delete('--keep')
55
57
  end
56
58
 
57
59
  def read_dot_rspec
@@ -113,7 +115,11 @@ module LearnTest
113
115
  end
114
116
 
115
117
  def cleanup
116
- FileUtils.rm('.results.json')
118
+ FileUtils.rm('.results.json') unless keep_results?
119
+ end
120
+
121
+ def keep_results?
122
+ keep_results
117
123
  end
118
124
  end
119
125
  end
@@ -1,3 +1,3 @@
1
1
  module LearnTest
2
- VERSION = '1.2.22'
2
+ VERSION = '1.2.23'
3
3
  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: 1.2.22
4
+ version: 1.2.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flatiron School
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler