rspec-interactive 0.9.12 → 0.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rspec-interactive/rspec_core_parser.rb +22 -0
- data/lib/rspec-interactive/version.rb +1 -1
- data/lib/rspec-interactive.rb +1 -0
- data/tests/parse_error_test.rb +17 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 463e635fc01d274aaaa0857835637651842862761bda52cf9f91e3474754f2e3
|
4
|
+
data.tar.gz: 996b14c18d7c8d26446e6c0bac18b0c566952c78d2cba365346a716021fa9a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c0ebae7aca82565ee027992003259a7abd4f1f0f049be0a1e8c31d382459f72eb9b3ea9b7000d8eddbe4236f47e036e442897e0a78558ee548946bb8de1cdd8
|
7
|
+
data.tar.gz: a1cae8c47176dd0f315335bbf8f63885653ae5f6e248aab2d885d9a38d6ee90124a5091dbfefa468b20c8307beeec7b4cc0f58202a2f0a5a473f2928cb5a9b63
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/rspec-interactive.rb
CHANGED
@@ -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.
|
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
|