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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca3d9ea9bc7a43930a9d3400a30b1c9d0bb06cc6691b70340966c8543b830646
4
- data.tar.gz: 6f22c4c95eb720509cabb7cd3edd18277b1b68f96bdca32ab7f55ff6197c3e11
3
+ metadata.gz: 58b63742b50c16f44d1cf19e2957e29ed07ef4a19c3ee91debed0624f519684a
4
+ data.tar.gz: 0217f523599d1ee0a104718bd3c2bd79aeaf9366d18a22f5abfdadb2ce1fc229
5
5
  SHA512:
6
- metadata.gz: f39caa7d3669358769a1aa5f8c901bfbfafbef2d9e5854e14a3331f87bfb5065cf42c3609dcb5d84940371811ae35b6168ed46effa99da032e9d4dae8e0a85d0
7
- data.tar.gz: 426d3c1feaec48508dfc48712914c40e278641c669a789b9902fa8a307c3ac349ed4cb580b008be8527d664cde94865d5e33b127a21192bf872f91261f3a93bc
6
+ metadata.gz: 7d5dbf2e0ec74668264fee718f5e2edaa60f0bff510433f376ac8264a64afb61b2a3538e8604f3c8cc4e0c1e48b409bb4bccfaedb25e0b587145d7b9f4abbb11
7
+ data.tar.gz: 86bba6bf0ad9728ba06d9374a3efb7b74cb4736fb24f5a81799e7ed4d54c499c012153ca2e90096caf0ab3965098c38cccc28b2b9c0d031723e7cc698b0a4fcc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-interactive (0.9.2)
4
+ rspec-interactive (0.9.3)
5
5
  listen
6
6
  pry
7
7
  rspec-core
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Interactive
5
- VERSION = "0.9.3"
5
+ VERSION = "0.9.4"
6
6
  end
7
7
  end
@@ -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 "Listening on port #{port}."
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
- configure_rspec
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
- configure_rspec
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
@@ -0,0 +1,3 @@
1
+ # RSpec Interactive Runner
2
+
3
+ Use this directory as the working directory in RubyMine run configurations.
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.3
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