spec_selector 0.1.9 → 0.2.1

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: 6bc35307d09216051323403138065f3970a1d14d6037b7637b373776d93368aa
4
- data.tar.gz: e3e3a425a985f4a42d3cb198710fb8404dd5d590e0d76156de8e8632df1a06d6
3
+ metadata.gz: 95f7236ff742ae326140598f31501fb4becb6981e841a9cce4c4487d78fcb75b
4
+ data.tar.gz: a6cbe3500f6fb6179c0e3ec5c81dcc0657da536999bc323315b1c59b931f242f
5
5
  SHA512:
6
- metadata.gz: bc580481d6aea4d71f3a97d9692f0b66894956842f91f84b72eee80af900e84013d55458ed21aab09e92b846bf76b5bba57590d6ed734db86eaf6cd8eb8be468
7
- data.tar.gz: 9638c80ac47b1af9d20cb0bea87580b8e88267cd3b6380cbf44f5984e401a78115f17e7818b7980f2f4d6a8ec0d47fac2d4b842e9e110226557c71b03dc0be7f
6
+ metadata.gz: 7b0f0e002b1cae381fac81da3fc4a9ae9079887226101a5a62905acea9e82d15d3103e0e66b96e6e3acd762de47c1e99be7b68ffe2f093c836f226fe28bbc5cd
7
+ data.tar.gz: 2c43c662af903063952dd06f3cc0d259f29fe5c791e542d25323980ec7f0f91e643025ac9b7b7fca13b10cfbeac3abca9be62477b2cc23f05c733fc02536f438
checksums.yaml.gz.sig CHANGED
Binary file
@@ -17,10 +17,10 @@ module SpecSelectorUtil
17
17
  # checks for a condition caused by that situation and leaves the error
18
18
  # information displayed until the user exits.
19
19
  def errors_before_formatter_initialization
20
- if @outside_errors_count.positive? && @messages == ['No examples found.']
21
- empty_line
22
- exit_only
23
- end
20
+ return unless @outside_errors_count.positive? && @messages == ['No examples found.']
21
+
22
+ empty_line
23
+ exit_only
24
24
  end
25
25
 
26
26
  def print_errors(notification)
@@ -95,7 +95,7 @@ module SpecSelectorUtil
95
95
  @exclude_passing ? include_passing! : exclude_passing!
96
96
  return if @example_display && @list != @passed && !@instructions
97
97
 
98
- exit_instruction_page if @instructions
98
+ exit_instruction_page
99
99
  p_data = parent_data(@selected.metadata)
100
100
  key = p_data ? p_data[:block] : :top_level
101
101
  new_list = @active_map[key]
@@ -139,6 +139,14 @@ module SpecSelectorUtil
139
139
  display_list
140
140
  end
141
141
 
142
+ def display_stderr_log
143
+ system("less #{stderr_log.path}")
144
+ end
145
+
146
+ def display_stdout_log
147
+ system("less #{stdout_log.path}")
148
+ end
149
+
142
150
  def refresh_display
143
151
  set_selected
144
152
  @example_display ? display_example : display_list
@@ -15,7 +15,7 @@ module SpecSelectorUtil
15
15
  ESCAPE_CODES.each do |sym, num|
16
16
  define_method(sym) do |text, included = false|
17
17
  formatted = "\e[#{num}m#{text}\e[0m"
18
- formatted = included ? formatted + ' ' : formatted
18
+ formatted = included ? "#{formatted}" : formatted
19
19
  @output.puts formatted
20
20
  end
21
21
  end
@@ -41,7 +41,7 @@ module SpecSelectorUtil
41
41
  included = item.metadata[:include]
42
42
 
43
43
  if @selected == item
44
- highlight(description, included)
44
+ highlight(description, included: included)
45
45
  else
46
46
  green(description, included) if all_passed?(data)
47
47
  yellow(description, included) if any_pending?(data) && !any_failed?(data)
@@ -61,7 +61,7 @@ module SpecSelectorUtil
61
61
  red("FAIL: #{@fail_count}")
62
62
  end
63
63
 
64
- def highlight(text, included = false)
64
+ def highlight(text, included: false)
65
65
  text += ' √' if included
66
66
  @output.puts "\e[1;7m#{text}\e[0m"
67
67
  end
@@ -70,7 +70,7 @@ module SpecSelectorUtil
70
70
  parent = parent_data(data)
71
71
  return data[:description] unless parent
72
72
 
73
- lineage(parent) + ' -> ' + data[:description]
73
+ "#{lineage(parent)} -> #{data[:description]}"
74
74
  end
75
75
 
76
76
  def format_example(status, data)
@@ -4,6 +4,16 @@ module SpecSelectorUtil
4
4
  # The Initialize module contains methods that initialize specific sets of
5
5
  # instance variables for the SpecSelector instance.
6
6
  module Initialize
7
+ STREAMS = %w[stderr stdout].freeze
8
+
9
+ STREAMS.each do |stream|
10
+ define_method("init_#{stream}_log") do
11
+ log = Tempfile.new(["#{stream}_log", '.txt'])
12
+ log.write("#{stream.upcase} LOG #{Time.now}:\n\n")
13
+ log
14
+ end
15
+ end
16
+
7
17
  def init_example_store
8
18
  @failed = []
9
19
  @passed = []
@@ -37,20 +47,20 @@ module SpecSelectorUtil
37
47
  @selector_index = 0
38
48
  end
39
49
 
40
- def get_locations
50
+ def locations
41
51
  if File.exist?(@locations_file)
42
- locations = File.open(@locations_file)
43
- @last_run_locations = JSON.load(locations)
52
+ stored_locations = File.open(@locations_file)
53
+ @last_run_locations = JSON.parse(stored_locations.read)
44
54
  @filter_mode = :location
45
55
  else
46
56
  @last_run_locations = []
47
57
  end
48
58
  end
49
59
 
50
- def get_descriptions
60
+ def descriptions
51
61
  if File.exist?(@descriptions_file)
52
62
  included = File.open(@descriptions_file)
53
- @last_run_descriptions = JSON.load(included)
63
+ @last_run_descriptions = JSON.parse(included.read)
54
64
  else
55
65
  @last_run_descriptions = []
56
66
  end
@@ -63,8 +73,16 @@ module SpecSelectorUtil
63
73
  @locations_file = "#{current_path}/inclusion_filter/locations.json"
64
74
  @inclusion_filter = []
65
75
  @filter_mode = :description
66
- get_descriptions
67
- get_locations
76
+ descriptions
77
+ locations
78
+ end
79
+
80
+ def stderr_log
81
+ @stderr_log ||= init_stderr_log
82
+ end
83
+
84
+ def stdout_log
85
+ @stdout_log ||= init_stdout_log
68
86
  end
69
87
 
70
88
  def initialize_all
@@ -20,21 +20,22 @@ module SpecSelectorUtil
20
20
  position_cursor(1, row)
21
21
  @output.puts notice
22
22
  reset_cursor
23
+
23
24
  nil
24
25
  end
25
26
 
26
27
  def display_filter_mode
27
- unless @inclusion_filter.empty?
28
- notice = "FILTER MODE: #{@filter_mode.to_s.upcase}"
29
- col = term_width / 2 - notice.length / 2
30
- position_cursor(1, col)
31
- italicize notice
32
- reset_cursor
33
- end
28
+ return if @inclusion_filter.empty?
29
+
30
+ notice = "FILTER MODE: #{@filter_mode.to_s.upcase}"
31
+ col = term_width / 2 - notice.length / 2
32
+ position_cursor(1, col)
33
+ italicize notice
34
+ reset_cursor
34
35
  end
35
36
 
36
37
  def back_instructions
37
- back_inst = 'Press [back] to view to parent group list'
38
+ back_inst = 'Press [backspace] to view to parent group list'
38
39
  escape_inst = 'Press [escape] to view to top-level group list'
39
40
 
40
41
  [back_inst, escape_inst].each do |inst|
@@ -66,10 +67,12 @@ module SpecSelectorUtil
66
67
  end
67
68
 
68
69
  def up_down_select_instructions
69
- up_down_inst = 'Press ↑ or ↓ to navigate list' if @list.count > 1
70
+ up_down_inst = 'Press ↑ or ↓ to navigate list'
70
71
  select_inst = 'press [enter] to select'
72
+ instructions_text = [select_inst]
73
+ instructions_text.unshift(up_down_inst) if @list.count > 1
71
74
 
72
- [up_down_inst, select_inst].each do |inst|
75
+ instructions_text.each do |inst|
73
76
  if @instructions
74
77
  bold(inst)
75
78
  empty_line
@@ -111,17 +114,33 @@ module SpecSelectorUtil
111
114
  empty_line
112
115
  end
113
116
 
117
+ bold('Press E to view stderr log')
118
+ empty_line
119
+ bold('Press O to view stdout log')
120
+ empty_line
114
121
  bold('Press I to exit instructions')
115
122
  empty_line
116
123
  bold('Press Q to quit')
117
124
  bind_input
118
125
  end
119
126
 
127
+ def toggle_instructions
128
+ unless @instructions
129
+ view_instructions_page
130
+ return
131
+ end
132
+
133
+ exit_instruction_page_only
134
+ end
135
+
120
136
  def top_fail_text
121
- bold 'Press [spacebar] to view top failed example'
137
+ text = 'Press [spacebar] to view top failed example'
138
+ @instructions ? bold(text) : @output.puts(text)
122
139
  end
123
140
 
124
141
  def exit_instruction_page
142
+ return unless @instructions
143
+
125
144
  @instructions = false
126
145
  close_alt_buffer
127
146
  end
@@ -1,12 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SpecSelectorUtil
4
+ # The State module contains methods that facilitate example rerun and filtering
2
5
  module State
3
6
  def rerun
4
7
  prepare_rerun
5
8
  descriptions, marker = appended_arguments
6
- rerun_script = current_path + '/scripts/rerun.sh'
7
- prepend = [rerun_script, Process.pid, Dir.pwd].join(' ')
8
- Signal.trap('TERM') { clear_frame; exit }
9
- system("#{prepend} #{$0} #{@rerun_arguments} #{descriptions} #{marker}")
9
+ rerun_script = "#{current_path}/scripts/rerun.sh"
10
+ prepended = [rerun_script, Process.pid, Dir.pwd].join(' ')
11
+
12
+ Signal.trap('TERM') do
13
+ clear_frame
14
+ exit
15
+ end
16
+
17
+ system("#{prepended} #{$PROGRAM_NAME} #{@rerun_arguments} #{descriptions} #{marker}")
10
18
  end
11
19
 
12
20
  def filter_include(item = @selected)
@@ -59,6 +67,13 @@ module SpecSelectorUtil
59
67
  @filter_mode = :descripton unless @inclusion_filter.any? { |item| one_liner?(item) }
60
68
  end
61
69
 
70
+ def add_or_remove_from_filter
71
+ return if @instructions
72
+
73
+ @selected.metadata[:include] ? filter_remove : filter_include
74
+ refresh_display
75
+ end
76
+
62
77
  def persist_descriptions
63
78
  @filtered_descriptions = @inclusion_filter.map do |item|
64
79
  item.metadata[:full_description]
@@ -92,7 +107,7 @@ module SpecSelectorUtil
92
107
  end
93
108
 
94
109
  def persist_locations
95
- @filtered_locations = @inclusion_filter.map { |item| item.location }
110
+ @filtered_locations = @inclusion_filter.map(&:location)
96
111
  locations = @filtered_locations.to_json
97
112
  File.write(@locations_file, locations)
98
113
  end
@@ -128,16 +143,17 @@ module SpecSelectorUtil
128
143
 
129
144
  def top_fail!
130
145
  return if @failed.empty?
146
+
131
147
  @inclusion_filter = []
132
148
  filter_include(@failed.first)
133
149
  rerun
134
150
  end
135
151
 
136
152
  def check_inclusion_status(item)
137
- if @last_run_descriptions.include?(item.metadata[:full_description])
138
- @inclusion_filter << item
139
- item.metadata[:include] = true
140
- end
153
+ return unless @last_run_descriptions.include?(item.metadata[:full_description])
154
+
155
+ @inclusion_filter << item
156
+ item.metadata[:include] = true
141
157
  end
142
158
  end
143
159
  end
@@ -5,8 +5,7 @@ module SpecSelectorUtil
5
5
  # function.
6
6
  module Terminal
7
7
  def clear_frame
8
- system("printf '\e[H'")
9
- system("printf '\e[3J'")
8
+ reset_cursor
10
9
  system("printf '\e[0J'")
11
10
  end
12
11
 
@@ -19,7 +18,7 @@ module SpecSelectorUtil
19
18
  end
20
19
 
21
20
  def term_height
22
- $stdout.winsize[0]
21
+ STDOUT.winsize[0]
23
22
  end
24
23
 
25
24
  def open_alt_buffer
@@ -35,7 +34,7 @@ module SpecSelectorUtil
35
34
  end
36
35
 
37
36
  def term_width
38
- $stdout.winsize[1]
37
+ STDOUT.winsize[1]
39
38
  end
40
39
 
41
40
  def position_cursor(row, col)
@@ -6,7 +6,19 @@ 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,
10
+ /^f$/i,
11
+ /^p$/i,
12
+ /^q$/i,
13
+ /^i$/i,
14
+ /^r$/i,
15
+ /^m$/i,
16
+ /^c$/i,
17
+ /^a$/i,
18
+ /^v$/i,
19
+ /^ $/,
20
+ /^e$/i,
21
+ /^o$/i
10
22
  ].freeze
11
23
 
12
24
  def exit_only
@@ -23,6 +35,8 @@ module SpecSelectorUtil
23
35
  def set_selected
24
36
  @list ||= @active_map[:top_level]
25
37
  @selected ||= @list.first
38
+
39
+ nil
26
40
  end
27
41
 
28
42
  def navigate
@@ -42,6 +56,8 @@ module SpecSelectorUtil
42
56
  clear_frame
43
57
  delete_filter_data
44
58
  reveal_cursor
59
+ stderr_log.unlink
60
+ stdout_log.unlink
45
61
  exit
46
62
  end
47
63
 
@@ -123,7 +139,7 @@ module SpecSelectorUtil
123
139
  end
124
140
  end
125
141
 
126
- def option_keys(input)
142
+ def option_keys(input) # rubocop:disable Metrics/CyclomaticComplexity
127
143
  case input
128
144
  when /^t$/i
129
145
  top_fail!
@@ -136,25 +152,21 @@ module SpecSelectorUtil
136
152
  when /^q$/i
137
153
  quit
138
154
  when /^i$/i
139
- unless @instructions
140
- view_instructions_page
141
- return
142
- end
143
-
144
- exit_instruction_page_only
155
+ toggle_instructions
145
156
  when /^r$/i
146
157
  rerun
147
158
  when /^a$/i
148
159
  rerun_all
149
160
  when /^m$/i
150
- return if @instructions
151
-
152
- @selected.metadata[:include] ? filter_remove : filter_include
153
- refresh_display
161
+ add_or_remove_from_filter
154
162
  when /^c$/i
155
163
  clear_filter
156
164
  when /^v$/i
157
165
  view_inclusion_filter
166
+ when /^e$/i
167
+ display_stderr_log
168
+ when /^o$/i
169
+ display_stdout_log
158
170
  end
159
171
  end
160
172
 
data/lib/spec_selector.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'io/console'
4
4
  require 'json'
5
- require 'rspec'
5
+ require 'tempfile'
6
6
  require_relative 'spec_selector/terminal'
7
7
  require_relative 'spec_selector/UI'
8
8
  require_relative 'spec_selector/format'
@@ -35,6 +35,8 @@ class SpecSelector
35
35
  :dump_summary
36
36
 
37
37
  def initialize(output)
38
+ $stderr = stderr_log
39
+ $stdout = stdout_log
38
40
  @output = output
39
41
  hide_cursor
40
42
  initialize_all
@@ -81,6 +83,7 @@ class SpecSelector
81
83
  end
82
84
 
83
85
  def dump_summary(notification)
86
+ $stdout = STDOUT
84
87
  @example_count = notification.example_count
85
88
  @outside_errors_count = notification.errors_outside_of_examples_count
86
89
  errors_before_formatter_initialization
data.tar.gz.sig CHANGED
Binary file
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.9
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Almon
@@ -11,55 +11,42 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIER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dh3nBuoPIA4q7LIx9Y3hUBtZqnHdD0dfFH+Wa56wncTWwX7xNZMk
33
- kWGyWUsnHi3aztuOqHYx2N9/5sQ6LUW5XCG+RdAhbRjg3fRw7kFgiIEbEiibo8da
34
- k2Xgy2eWwGKB1H5GYaooq8yKpbWcQT160/4gh9OJc7AINqlFNkKdv2FWcjoqE+Ht
35
- cbztMoJB1BmhofTWwU3/JKv/sWKXKzd6caHY7GVAxbwluQ5J7CUPfw==
27
+ cmV2b3JhbG1vbkBnbWFpbC5jb20wDQYJKoZIhvcNAQELBQADggGBADhy7QHMAvXf
28
+ pQOksLfTxjjWBJfxW84B23Utoc0wD5yP+xm2Uv0SHiWX2ukybRg5BCJz9LpkeDY0
29
+ FuMG1hm3CHBjxBIyjHhzuEUJRSpcR3bTH8jc3WxvTCGKDwHIwMHbY+hQNtCuS5M1
30
+ YiXttMk3/y3lIUGxMf7VPLD03l3QVMsj/3GceJuVfBcZJm2c1lfWL5K85DUWerEo
31
+ zb3BrXXwfuDu/56wG6BVrBKY2MwqXFyR/xqQ96u2KE1n8z+y19ARMknow59cgEJL
32
+ E+UgfC9vyJskqTZ4L91I7Rc/mUNuVBnXnaZ6Kd/i76exWEr9H5EtBYjKhpWZ7rt8
33
+ qTXz4RMB4CCBSyXpCAShHYsAt0N9OkEJ8Ki6PgeI0FjCBA+8QaLSihO8vdrp628t
34
+ a8m4ZZ7xU7ngZyZSwY5vH2tPDMGOqIq0Qfdw0AmguMbuWj9D+bT/WRvJzRTklrzF
35
+ fvwaNYbvZyi8NkRW0QY4PGZ422STOZ55kjuI6jJq1b4eXRqrLDsNMA==
36
36
  -----END CERTIFICATE-----
37
- date: 2022-03-02 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'
46
- type: :runtime
47
- prerelease: false
48
- version_requirements: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - "~>"
51
- - !ruby/object:Gem::Version
52
- version: '3.0'
53
- description: " SpecSelector is an RSpec formatter that opens a utility \n menu in
54
- your terminal window when you run tests (rather \n than just printing static text).
55
- The utility allows you to \n select, view, filter, and rerun specific test results
56
- with \n simple key controls.\n"
37
+ date: 2024-01-01 00:00:00.000000000 Z
38
+ dependencies: []
39
+ description: |2
40
+ SpecSelector is an RSpec formatter that opens a utility
41
+ menu in your terminal window when you run tests (rather
42
+ than just printing static text). The utility allows you to
43
+ select, view, filter, and rerun specific test results with
44
+ simple key controls.
57
45
  email: trevoralmon@gmail.com
58
46
  executables: []
59
47
  extensions: []
60
48
  extra_rdoc_files: []
61
49
  files:
62
- - README.md
63
50
  - lib/spec_selector.rb
64
51
  - lib/spec_selector/data_map.rb
65
52
  - lib/spec_selector/data_presentation.rb
@@ -87,14 +74,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
74
  requirements:
88
75
  - - ">="
89
76
  - !ruby/object:Gem::Version
90
- version: 2.0.0
77
+ version: '2.5'
91
78
  required_rubygems_version: !ruby/object:Gem::Requirement
92
79
  requirements:
93
80
  - - ">="
94
81
  - !ruby/object:Gem::Version
95
82
  version: '0'
96
83
  requirements: []
97
- rubygems_version: 3.2.21
84
+ rubygems_version: 3.1.2
98
85
  signing_key:
99
86
  specification_version: 4
100
87
  summary: A results viewer and filter utility for RSpec
metadata.gz.sig CHANGED
Binary file
data/README.md DELETED
@@ -1,97 +0,0 @@
1
- # spec_selector
2
-
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
-
5
- <br>
6
-
7
- **View test results**
8
-
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**
14
-
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.
16
-
17
- Without using the selection tool, press F to rerun only failed tests. Press T to rerun only the top failed test.
18
-
19
- Press C to clear the inclusion filter. Press A to clear the inclusion filter and rerun RSpec with all tests.
20
-
21
- Press V to view the inclusion filter as a selection list.
22
-
23
- <br>
24
-
25
- _Filter Modes_
26
-
27
- Whenever the inclusion filter is not empty, the filter mode will display at the top center of the terminal window.
28
-
29
- There are two filter modes: _description_ and _location_.
30
-
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.
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
-
67
- **Installation**
68
-
69
- ````
70
- gem install spec_selector
71
- ````
72
-
73
- Once installed, add the following line to your .rspec file:
74
-
75
- ````
76
- --format SpecSelector
77
- ````
78
-
79
- Or, use the -f option on the command line
80
-
81
- ````
82
- rspec -f SpecSelector
83
- ````
84
-
85
- <br>
86
- <br>
87
-
88
-
89
-
90
- **Author:** Trevor Almon\
91
- **License:** MIT License\
92
- **rubygems url:** https://rubygems.org/gems/spec_selector
93
-
94
-
95
-
96
-
97
-