spec_selector 0.1.1 → 0.1.6

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: 104ca07b618484c40fbaa4bc5debad46432d73115ffe13ae07a2e420bd77d546
4
- data.tar.gz: '069f85d4132c26c859ae51cf26ffd0f756684e6f5e6bc1b9aec0bc08ea23bb32'
3
+ metadata.gz: 672bcd2f4168b0180a9654339c5775ab5396a00d1b0ac15e01de416136b146c9
4
+ data.tar.gz: d4e047811545276316641e46413c2f3484a00bd27bedc6c4ee19e2dfd5d3ce3a
5
5
  SHA512:
6
- metadata.gz: 24f1384f0dddfad7b1604d9496963d54c599a2148259782599528738123969bdd6de05e28a0d3cbb75005ad92a2fc374f79570f0200bbb13eb1d2c394aea541b
7
- data.tar.gz: 2e392f4fad2eb0b12d083ab9d6a10cd5bfb401a92efa4a7b6b095b521cf3b89dfffac6f54da8eeac0a141934b15de94e5374e9ec2785898c854c373aea696ac6
6
+ metadata.gz: 5f1184a526b297c848016fe5f44ecc7cbcefd91d427d6ddb27e1f438281ce1c5d66f2f1e6f3c571f7a776f603a25bdfa5422004dffc6391942ab0df4eff02a30
7
+ data.tar.gz: a6162d415c72dfbefa45fffec5e5bf5b4e7f29cb673d804408234b3c9e6b16f2bb57284f4aa8b5c78c73aadffcb2398911029be27edc257f2b38f09af162320d
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ **version 0.1.6**
2
+ <br>
3
+ <br>
4
+ Corrected a test rerun bug as well as a problem with key control regex patterns; made a slight modification to key controls: T is no longer case-sensitive and will now rerun the top failed test result from the current set. To view the top failed result from the current set without rerunning, press SPACEBAR.
data/README.md CHANGED
@@ -1,21 +1,27 @@
1
1
  # spec_selector
2
2
 
3
- SpecSelector is an RSpec formatter than opens a utility menu in your terminal window when you run tests (rather than just printing static text). The utility allows you to select, view, filter, and rerun specific test results with simple key controls.
3
+ SpecSelector is an RSpec formatter that opens a utility menu in your terminal window when you run tests (rather than just printing static text). The utility allows you to select, view, filter, and rerun specific test results with simple key controls.
4
4
 
5
- **view test results**
5
+ <br>
6
6
 
7
- Upon finishing the test run, the test result tree appears as a formatted list of top-level example groups. Select an example group to view its subgroups, select a subgroup to view its examples, and so on. You can view your test results with the selection tool, or just press T to immediately view the top failed test.
7
+ **View test results**
8
8
 
9
- **filter and rerun test results**
9
+ Upon finishing the test run, the test result tree appears as a formatted list of top-level example groups. Select an example group to view its subgroups, select a subgroup to view its examples, and so on. You can view your test results with the selection tool, or just press t to immediately view the top failed test.
10
+
11
+ <br>
12
+
13
+ **Filter and rerun test results**
10
14
 
11
15
  Using the selection tool, press M to add the selected group or example to the inclusion filter. Press R to rerun RSpec with only selected tests.
12
16
 
13
- Without using the selection tool, press F to rerun only failed tests. Press SHIFT + T to rerun only the top failed test.
17
+ Without using the selection tool, press F to rerun only failed tests. Press T to rerun only the top failed test.
14
18
 
15
19
  Press C to clear the inclusion filter. Press A to clear the inclusion filter and rerun RSpec with all tests.
16
20
 
17
21
  Press V to view the inclusion filter as a selection list.
18
22
 
23
+ <br>
24
+
19
25
  _Filter Modes_
20
26
 
21
27
  Whenever the inclusion filter is not empty, the filter mode will display at the top center of the terminal window.
@@ -24,6 +30,40 @@ There are two filter modes: _description_ and _location_.
24
30
 
25
31
  The filter always uses description matching by default, but will use location (line number) matching if examples without descriptions (i.e. "one-liners") are selected for inclusion.
26
32
 
33
+ <br>
34
+
35
+ **Usage notes**
36
+
37
+ _Text color_
38
+
39
+ An example description will appear in red text if the example failed, yellow text if the example is pending, or green text if the example passed.
40
+
41
+ The color of an example group description is determined by the result status of its examples or recursively by the examples of its subgroups. The description will appear in red text if at least one failed example is present in its tree (e.g. if it contains a subgroup that contains a failed example), yellow text if its tree contains no failed examples and at least one pending example, or green text if every example in its tree passed.
42
+
43
+ <br>
44
+
45
+ _key controls_
46
+
47
+ Key control | Description
48
+ ------------|--------------
49
+ | BACKSPACE | View the list that contains the parent of the current list or example result summary.|
50
+ | ENTER/RETURN | Select an example group or example from the result list.|
51
+ | ESCAPE | Return to the top-level result list. If already viewing the top-level list, the escape key has no effect.|
52
+ | SPACEBAR | View the top failed example result summary from the current result set. |
53
+ | UP/DOWN | Navigate up and down the result list, or, if viewing an example result summary, view the next or previous example result summary.|
54
+ | A | Clear the inclusion filter and rerun RSpec with all examples.|
55
+ | C | Clear the inclusion filter.|
56
+ | F | Rerun RSpec with only failed examples from the current result set. |
57
+ | I | View or exit instructions.|
58
+ | M | Include or remove an example or example group from the inclusion filter. |
59
+ | P | Hide or reveal passing examples in the current result set. |
60
+ | R | Rerun RSpec with only examples and example groups marked for inclusion. |
61
+ | T | Rerun RSpec with only the top failed example from the current result set. |
62
+ | V | View the inclusion filter as a list. |
63
+ | Q | Exit spec_selector. |
64
+
65
+ <br>
66
+
27
67
  **Installation**
28
68
 
29
69
  ````
@@ -41,6 +81,9 @@ Or, use the -f option on the command line
41
81
  ````
42
82
  rspec -f SpecSelector
43
83
  ````
84
+
85
+ <br>
86
+ <br>
44
87
 
45
88
 
46
89
 
data/lib/spec_selector.rb CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  require 'io/console'
4
4
  require 'json'
5
- require 'byebug'
6
- require 'pry'
5
+ require 'rspec'
7
6
  require_relative 'spec_selector/terminal'
8
7
  require_relative 'spec_selector/UI'
9
8
  require_relative 'spec_selector/format'
@@ -99,7 +99,7 @@ module SpecSelectorUtil
99
99
  empty_line
100
100
  bold('Press F to rerun only failed examples')
101
101
  empty_line
102
- bold('Press SHIFT + T to rerun only the top failed example')
102
+ bold('Press T to rerun only the top failed example')
103
103
  empty_line
104
104
  bold('Press M to include or remove selected item from run filter')
105
105
  empty_line
@@ -118,7 +118,7 @@ module SpecSelectorUtil
118
118
  end
119
119
 
120
120
  def top_fail_text
121
- bold 'Press T to view top failed example'
121
+ bold 'Press t to view top failed example'
122
122
  end
123
123
 
124
124
  def exit_instruction_page
@@ -127,6 +127,7 @@ module SpecSelectorUtil
127
127
  end
128
128
 
129
129
  def top_fail!
130
+ return if @failed.empty?
130
131
  @inclusion_filter = []
131
132
  filter_include(@failed.first)
132
133
  rerun
@@ -6,12 +6,12 @@ module SpecSelectorUtil
6
6
  DIRECTION_KEYS = ["\e[A", "\e[B"].freeze
7
7
  TREE_NAVIGATION_KEYS = ["\r", "\x7F", "\e"].freeze
8
8
  OPTION_KEYS = [
9
- /t/i, /f/i, /p/i, /q/i, /i/i, /r/i, /m/i, /c/i, /a/i, /v/i
9
+ /^t$/i, /^f$/i, /^p$/i, /^q$/i, /^i$/i, /^r$/i, /^m$/i, /^c$/i, /^a$/i, /^v$/i, /^ $/
10
10
  ].freeze
11
11
 
12
12
  def exit_only
13
13
  q_to_exit
14
- loop { quit if user_input.match?(/q/i) }
14
+ loop { quit if user_input.match?(/^q$/i) }
15
15
  end
16
16
 
17
17
  def selector
@@ -125,35 +125,35 @@ module SpecSelectorUtil
125
125
 
126
126
  def option_keys(input)
127
127
  case input
128
- when /T/
128
+ when /^t$/i
129
129
  top_fail!
130
- when /t/
130
+ when /^ $/
131
131
  top_fail
132
- when /p/i
132
+ when /^p$/i
133
133
  toggle_passing
134
- when /f/i
134
+ when /^f$/i
135
135
  run_only_fails
136
- when /q/i
136
+ when /^q$/i
137
137
  quit
138
- when /i/i
138
+ when /^i$/i
139
139
  unless @instructions
140
140
  view_instructions_page
141
141
  return
142
142
  end
143
143
 
144
144
  exit_instruction_page_only
145
- when /r/i
145
+ when /^r$/i
146
146
  rerun
147
147
  when /^a$/i
148
148
  rerun_all
149
- when /m/i
149
+ when /^m$/i
150
150
  return if @instructions
151
151
 
152
152
  @selected.metadata[:include] ? filter_remove : filter_include
153
153
  refresh_display
154
154
  when /^c$/i
155
155
  clear_filter
156
- when /v/i
156
+ when /^v$/i
157
157
  view_inclusion_filter
158
158
  end
159
159
  end
@@ -376,28 +376,28 @@ describe 'SpecSelectorUtil::UI' do
376
376
  allow_methods(:top_fail, :toggle_passing, :quit)
377
377
  end
378
378
 
379
- context 'when input string matches /t/i' do
379
+ context 'when input string matches /^ $/' do
380
380
  it 'calls #top_fail' do
381
- spec_selector.option_keys('t')
381
+ spec_selector.option_keys(' ')
382
382
  expect(spec_selector).to have_received(:top_fail)
383
383
  end
384
384
  end
385
385
 
386
- context 'when input string matches /p/i' do
386
+ context 'when input string matches /^p$/i' do
387
387
  it 'calls #toggle_passing' do
388
388
  spec_selector.option_keys('p')
389
389
  expect(spec_selector).to have_received(:toggle_passing)
390
390
  end
391
391
  end
392
392
 
393
- context 'when input string matches /q/i' do
393
+ context 'when input string matches /^q$/i' do
394
394
  it 'calls #quit' do
395
395
  spec_selector.option_keys('q')
396
396
  expect(spec_selector).to have_received(:quit)
397
397
  end
398
398
  end
399
399
 
400
- context 'when input string matches /i/i' do
400
+ context 'when input string matches /^i$/i' do
401
401
  context 'when instruction page is not open' do
402
402
  it 'calls #view_instructions_page' do
403
403
  allow(spec_selector).to receive(:view_instructions_page)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spec_selector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Almon
@@ -34,17 +34,38 @@ cert_chain:
34
34
  2oaEU1xxH+4n3qzECM32PIry9QVrTud/3/ouDLy4LVVyutD5ZANsVQrr0y8vEA6+
35
35
  OXcnI0Yc8EI4dmIAwDI0ZfBo2OgFBxNJCeurVx36tUPsSWjJUd0BeA==
36
36
  -----END CERTIFICATE-----
37
- date: 2021-02-19 00:00:00.000000000 Z
38
- dependencies: []
39
- description: " SpecSelector is an RSpec formatter than opens a utility menu \n in
40
- your terminal window when you run tests (rather than just \n printing static text).
41
- The utility allows you to select, view, \n filter, and rerun specific test results
42
- with simple key controls.\n"
37
+ date: 2021-03-30 00:00:00.000000000 Z
38
+ dependencies:
39
+ - !ruby/object:Gem::Dependency
40
+ name: rspec
41
+ requirement: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 3.0.0
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: '4'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 3.0.0
56
+ - - "<"
57
+ - !ruby/object:Gem::Version
58
+ version: '4'
59
+ description: " SpecSelector is an RSpec formatter that opens a utility \n menu in
60
+ your terminal window when you run tests (rather \n than just printing static text).
61
+ The utility allows you to \n select, view, filter, and rerun specific test results
62
+ with \n simple key controls.\n"
43
63
  email: trevoralmon@gmail.com
44
64
  executables: []
45
65
  extensions: []
46
66
  extra_rdoc_files: []
47
67
  files:
68
+ - CHANGELOG.md
48
69
  - README.md
49
70
  - lib/spec_selector.rb
50
71
  - lib/spec_selector/data_map.rb
@@ -74,6 +95,7 @@ licenses:
74
95
  metadata:
75
96
  source_code_uri: https://github.com/TrevorA-TrevorA/spec_selector
76
97
  homepage_uri: https://github.com/TrevorA-TrevorA/spec_selector
98
+ changelog_uri: https://github.com/TrevorA-TrevorA/spec_selector/blob/master/CHANGELOG.md
77
99
  post_install_message:
78
100
  rdoc_options: []
79
101
  require_paths:
metadata.gz.sig CHANGED
Binary file