rspec-interactive 0.9.12 → 0.9.14

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: d723a8386eb4ed50df0bde9d90efacb2a8d6472f06faefa711afca46bdd87ae5
4
- data.tar.gz: 79c582d886cc31909d7f43c46ec5f9cfffdc8d8f3f9371e85d4e15d496c9cf43
3
+ metadata.gz: 5fa7f485edd73e508aae2ef78bc0a1e6732ff68d21426167286593a403d62e8d
4
+ data.tar.gz: ce16787bd05a0fb8f58ee345b5364e3b7ecd2ae4c6facff80de4c79da1529e28
5
5
  SHA512:
6
- metadata.gz: d2bf91dd9111564260b331113842d0fc39991908f8e7707a91589ce6ddaee5ece21916f1aee89c70719cbb0da7854b668dca998f4caa17f488d6f8097e705d81
7
- data.tar.gz: 3d24e2e9c3b7b17f87dd56252346b94e78da69abf023889d23b8e89258c8970ad239aebb91f6e507d0dd441a252636240147d70fcfb7a4a0fe93259be6a22fea
6
+ metadata.gz: 67d4cf6b38665652da822cf984a147b8e6446a508436e89adf40606cdaa661060d4b089541b43b4524e4549265cb4e6a72e8c9355b6a376c6ba41de6f3a59421
7
+ data.tar.gz: 98d9746462b2de2bdde2c0041d52401f333032760aaee6355a387a6753533d0fd0bf2363574f71b6855d502c9c2c06cb3e99ae78c6fca077de641ed088f3234b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-interactive (0.9.11)
4
+ rspec-interactive (0.9.13)
5
5
  pry
6
6
  rspec-core
7
7
  rspec-teamcity (= 1.0.0)
@@ -11,7 +11,6 @@ GEM
11
11
  specs:
12
12
  coderay (1.1.3)
13
13
  diff-lcs (1.4.4)
14
- ffi (1.15.5)
15
14
  ffi (1.15.5-java)
16
15
  method_source (1.0.0)
17
16
  pry (0.14.1)
@@ -0,0 +1,22 @@
1
+ require 'rspec/core/option_parser'
2
+
3
+ # RSpec::Core::Parser calls abort on parse error. This kills the process.
4
+ # Here we replace abort so that it will raise instead.
5
+
6
+ # In some cases abort is called in response to an exception. If we simply raise,
7
+ # the original exception will be logged as the cause. This will lead to duplicate
8
+ # messaging. Here we define our own exception so that we can ensure no cause is
9
+ # logged.
10
+ class ParseError < StandardError
11
+ def cause
12
+ nil
13
+ end
14
+ end
15
+
16
+ module RSpec::Core
17
+ class Parser
18
+ def abort(msg)
19
+ raise ParseError.new(msg)
20
+ end
21
+ end
22
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Interactive
5
- VERSION = "0.9.12"
5
+ VERSION = "0.9.14"
6
6
  end
7
7
  end
@@ -16,6 +16,7 @@ require 'rspec-interactive/refresh_command'
16
16
  require 'rspec-interactive/rspec_command'
17
17
  require 'rspec-interactive/rspec_config_cache'
18
18
  require 'rspec-interactive/rspec_core_example'
19
+ require 'rspec-interactive/rspec_core_parser'
19
20
  require 'rspec-interactive/rubo_cop_command'
20
21
  require 'rspec-interactive/runner'
21
22
  require 'rspec-interactive/stdio'
@@ -275,11 +276,14 @@ module RSpec
275
276
  end
276
277
 
277
278
  def self.rubo_cop(args)
278
- if defined?(RuboCop)
279
- RuboCop::CLI.new.run args
280
- else
279
+ begin
280
+ require 'rubocop'
281
+ rescue LoadError
281
282
  @error_stream.puts "fatal: RuboCop not found. Is the gem installed in this project?"
283
+ return
282
284
  end
285
+
286
+ RuboCop::CLI.new.run args
283
287
  end
284
288
 
285
289
  def self.eval(line, options, &block)
@@ -9,7 +9,7 @@ require 'socket'
9
9
  port: 5678
10
10
  }
11
11
 
12
- parser = OptionParser.new do |opts|
12
+ OptionParser.new do |opts|
13
13
  opts.banner = "Executes RSpec by connecting to a running RSpec Interactive shell.\n\n"\
14
14
  "Usage: bundle exec rspec-interactive-run [--host <host>] [--port <port>] [rspec-args]"
15
15
 
@@ -0,0 +1,17 @@
1
+ require_relative 'support/test_helper'
2
+
3
+ Test.test "parse error" do
4
+ await_prompt
5
+ input "rspec --foo"
6
+ await_prompt
7
+ input "exit"
8
+ await_termination
9
+ expect_equal "output", output.gsub(/^from .*lib\/rspec-interactive/, 'from [...]'), <<~EOF
10
+ [1] pry(main)> rspec --foo
11
+ ParseError: invalid option: --foo
12
+
13
+ Please use --help for a listing of valid options
14
+ from [...]/rspec_core_parser.rb:19:in `abort'
15
+ [1] pry(main)> exit
16
+ EOF
17
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-interactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.12
4
+ version: 0.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Dower
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core
@@ -85,6 +85,7 @@ files:
85
85
  - lib/rspec-interactive/rspec_command.rb
86
86
  - lib/rspec-interactive/rspec_config_cache.rb
87
87
  - lib/rspec-interactive/rspec_core_example.rb
88
+ - lib/rspec-interactive/rspec_core_parser.rb
88
89
  - lib/rspec-interactive/rubo_cop_command.rb
89
90
  - lib/rspec-interactive/runner.rb
90
91
  - lib/rspec-interactive/stdio.rb
@@ -93,11 +94,8 @@ files:
93
94
  - lib/rspec-interactive/version.rb
94
95
  - lib/teamcity/spec/runner/formatter/teamcity/formatter.rb
95
96
  - rspec-interactive.gemspec
96
- - runner/Gemfile
97
- - runner/Gemfile.lock
98
- - runner/README.md
99
- - runner/rspec-interactive-run
100
97
  - scripts/release.sh
98
+ - scripts/rspec-interactive-run
101
99
  - scripts/run-with-local-dep.sh
102
100
  - tests/debugged_spec_test.rb
103
101
  - tests/eof_test.rb
@@ -105,6 +103,7 @@ files:
105
103
  - tests/failing_spec_test.rb
106
104
  - tests/glob_test.rb
107
105
  - tests/line_number_test.rb
106
+ - tests/parse_error_test.rb
108
107
  - tests/passing_spec_test.rb
109
108
  - tests/rerun_failed_specs_test.rb
110
109
  - tests/spec_with_syntax_error_test.rb
@@ -132,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
131
  - !ruby/object:Gem::Version
133
132
  version: '0'
134
133
  requirements: []
135
- rubygems_version: 3.2.3
134
+ rubygems_version: 3.3.3
136
135
  signing_key:
137
136
  specification_version: 4
138
137
  summary: An interactive console for running specs.
data/runner/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ruby '3.0.0'
4
-
5
- source "https://rubygems.org"
data/runner/Gemfile.lock DELETED
@@ -1,14 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
-
5
- PLATFORMS
6
- x86_64-darwin-20
7
-
8
- DEPENDENCIES
9
-
10
- RUBY VERSION
11
- ruby 3.0.0p0
12
-
13
- BUNDLED WITH
14
- 2.3.6
data/runner/README.md DELETED
@@ -1,3 +0,0 @@
1
- # RSpec Interactive Runner
2
-
3
- Use this directory as the working directory in RubyMine run configurations.