rspec-interactive 0.9.3 → 0.9.4
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/version.rb +1 -1
- data/lib/rspec-interactive.rb +26 -18
- data/runner/README.md +3 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58b63742b50c16f44d1cf19e2957e29ed07ef4a19c3ee91debed0624f519684a
|
4
|
+
data.tar.gz: 0217f523599d1ee0a104718bd3c2bd79aeaf9366d18a22f5abfdadb2ce1fc229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d5dbf2e0ec74668264fee718f5e2edaa60f0bff510433f376ac8264a64afb61b2a3538e8604f3c8cc4e0c1e48b409bb4bccfaedb25e0b587145d7b9f4abbb11
|
7
|
+
data.tar.gz: 86bba6bf0ad9728ba06d9374a3efb7b74cb4736fb24f5a81799e7ed4d54c499c012153ca2e90096caf0ab3965098c38cccc28b2b9c0d031723e7cc698b0a4fcc
|
data/Gemfile.lock
CHANGED
data/lib/rspec-interactive.rb
CHANGED
@@ -58,18 +58,12 @@ module RSpec
|
|
58
58
|
check_rails
|
59
59
|
trap_interrupt
|
60
60
|
configure_pry
|
61
|
-
|
62
|
-
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
63
|
-
@config_cache.record_configuration { @configuration.configure_rspec.call }
|
64
|
-
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
65
|
-
if end_time - start_time > 5
|
66
|
-
@output_stream.puts "Configuring RSpec took #{(end_time - start_time).round} seconds."
|
67
|
-
end
|
61
|
+
load_rspec_configuration
|
68
62
|
|
69
63
|
start_file_watcher
|
70
64
|
|
71
65
|
if server
|
72
|
-
@output_stream.puts "
|
66
|
+
@output_stream.puts "listening on port #{port}"
|
73
67
|
server_thread = Thread.start do
|
74
68
|
server = TCPServer.new port
|
75
69
|
|
@@ -96,14 +90,6 @@ module RSpec
|
|
96
90
|
end
|
97
91
|
end
|
98
92
|
|
99
|
-
def self.configure_rspec(error_stream: @error_stream, output_stream: @output_stream)
|
100
|
-
RSpec.configure do |config|
|
101
|
-
config.error_stream = error_stream
|
102
|
-
config.output_stream = output_stream
|
103
|
-
config.start_time = RSpec::Core::Time.now
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
93
|
def self.trap_interrupt
|
108
94
|
trap('INT') do
|
109
95
|
if @runner
|
@@ -127,6 +113,20 @@ module RSpec
|
|
127
113
|
@listener.start
|
128
114
|
end
|
129
115
|
|
116
|
+
def self.load_rspec_configuration
|
117
|
+
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
118
|
+
config_thread = Thread.start do
|
119
|
+
@config_cache.record_configuration { @configuration.configure_rspec.call }
|
120
|
+
end
|
121
|
+
unless config_thread.join(3)
|
122
|
+
@output_stream.puts "executing configure_rspec hook..."
|
123
|
+
end
|
124
|
+
config_thread.join
|
125
|
+
|
126
|
+
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
127
|
+
@output_stream.puts "configure_rspec hook took #{(end_time - start_time).round} seconds" if end_time - start_time > 5
|
128
|
+
end
|
129
|
+
|
130
130
|
def self.configure_pry
|
131
131
|
# Prevent Pry from trapping too. It will break ctrl-c handling.
|
132
132
|
Pry.config.should_trap_interrupts = false
|
@@ -180,7 +180,11 @@ module RSpec
|
|
180
180
|
Pry.config.history_save = false
|
181
181
|
|
182
182
|
# RSpec::Interactive-specific RSpec configuration
|
183
|
-
|
183
|
+
RSpec.configure do |config|
|
184
|
+
config.error_stream = @error_stream
|
185
|
+
config.output_stream = @output_stream
|
186
|
+
config.start_time = RSpec::Core::Time.now
|
187
|
+
end
|
184
188
|
|
185
189
|
# Run.
|
186
190
|
exit_code = @runner.run
|
@@ -210,7 +214,11 @@ module RSpec
|
|
210
214
|
refresh
|
211
215
|
|
212
216
|
# RSpec::Interactive-specific RSpec configuration
|
213
|
-
|
217
|
+
RSpec.configure do |config|
|
218
|
+
config.error_stream = @error_stream
|
219
|
+
config.output_stream = @output_stream
|
220
|
+
config.start_time = RSpec::Core::Time.now
|
221
|
+
end
|
214
222
|
|
215
223
|
# RubyMine specifies --format. That causes a formatter to be added. It does not override
|
216
224
|
# the existing formatter (if one is set by default). Clear any formatters but resetting
|
data/runner/README.md
ADDED
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Dower
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- rspec-interactive.gemspec
|
108
108
|
- runner/Gemfile
|
109
109
|
- runner/Gemfile.lock
|
110
|
+
- runner/README.md
|
110
111
|
- runner/rspec-interactive-run
|
111
112
|
- scripts/release.sh
|
112
113
|
- scripts/run-with-local-dep.sh
|