rspec-interactive 0.9.12 → 0.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d723a8386eb4ed50df0bde9d90efacb2a8d6472f06faefa711afca46bdd87ae5
4
- data.tar.gz: 79c582d886cc31909d7f43c46ec5f9cfffdc8d8f3f9371e85d4e15d496c9cf43
3
+ metadata.gz: 463e635fc01d274aaaa0857835637651842862761bda52cf9f91e3474754f2e3
4
+ data.tar.gz: 996b14c18d7c8d26446e6c0bac18b0c566952c78d2cba365346a716021fa9a95
5
5
  SHA512:
6
- metadata.gz: d2bf91dd9111564260b331113842d0fc39991908f8e7707a91589ce6ddaee5ece21916f1aee89c70719cbb0da7854b668dca998f4caa17f488d6f8097e705d81
7
- data.tar.gz: 3d24e2e9c3b7b17f87dd56252346b94e78da69abf023889d23b8e89258c8970ad239aebb91f6e507d0dd441a252636240147d70fcfb7a4a0fe93259be6a22fea
6
+ metadata.gz: 7c0ebae7aca82565ee027992003259a7abd4f1f0f049be0a1e8c31d382459f72eb9b3ea9b7000d8eddbe4236f47e036e442897e0a78558ee548946bb8de1cdd8
7
+ data.tar.gz: a1cae8c47176dd0f315335bbf8f63885653ae5f6e248aab2d885d9a38d6ee90124a5091dbfefa468b20c8307beeec7b4cc0f58202a2f0a5a473f2928cb5a9b63
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.12)
5
5
  pry
6
6
  rspec-core
7
7
  rspec-teamcity (= 1.0.0)
@@ -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.13"
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'
@@ -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,7 +1,7 @@
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.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Dower
@@ -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
@@ -105,6 +106,7 @@ files:
105
106
  - tests/failing_spec_test.rb
106
107
  - tests/glob_test.rb
107
108
  - tests/line_number_test.rb
109
+ - tests/parse_error_test.rb
108
110
  - tests/passing_spec_test.rb
109
111
  - tests/rerun_failed_specs_test.rb
110
112
  - tests/spec_with_syntax_error_test.rb