rspec-daemon 1.0.0 → 1.1.0

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: 208bd76b8815eaf702f7b32c3cfd987551c122d49e63f8f7c2bd912c84e81b31
4
- data.tar.gz: 96b0bae9c7f30441345b8e85419be284fdecb1d112e7ae842ccd76c26c1b476d
3
+ metadata.gz: 34268638889a4b7657ec87ecf13fe579c32c79753c5299fdd8f62dab0a31703f
4
+ data.tar.gz: 19cccfc47d8a9e0f03f04d80fa6f355d62ebf39dcaadc2d15113cfa68ffc8e38
5
5
  SHA512:
6
- metadata.gz: 2fc0fc6bded50693fd5db0e9f8d05fb7cb9980a146467548a1889f7e1435623947b67b5decb5baea37e65b2c0c7fc99b9c224a16968020964a46f013542625b9
7
- data.tar.gz: c22c13bd14953714bc393ea81423895a94a310be7c4e10d0d2ed49af3d021d179cb5335b6d505fa1cf22c481fd11f1cc26fb1a8cdab6628b2a1e70a9a8dce245
6
+ metadata.gz: 4b770f2cfb61e332e9e2e672dd97fac2a33bf1386d28d5300a02daffb8e332d65adadacfa25016cf1b743a6ab6eeed46f66a6d752e524eb763abedf49348d635
7
+ data.tar.gz: '01877ce39e845297adc62697f00894b2b7de0dfd8e685cae1b17bbd31b4783549e45694e4e52bb944310c48cf5deb23eca9e22b6534bfcef26dfa7af94164a99'
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
- ## [Unreleased]
1
+ ## [1.1.0] - 2023-12-16
2
2
 
3
- ## [1.0.0]
3
+ - Rails: Invoke autoreloading on every run #11 @osyoyu
4
+
5
+ ## [1.0.1] - 2023-12-16
6
+
7
+ - Fix the method to start the test #9 @ta1kt0me
8
+
9
+ ## [1.0.0] - 2023-12-15
4
10
 
5
11
  - Make bind address and port configurable #7 @osyoyu
6
12
  - Remove pry dependency #6 @osyoyu
data/README.md CHANGED
@@ -43,6 +43,21 @@ $ echo 'spec/models/user_spec.rb' | nc -v 0.0.0.0 3002
43
43
 
44
44
  By default, `rspec-daemon` will run on port `3002`. You can adjust the port by passing `--port` to `rspec-daemon` or setting the `RSPEC_DAEMON_PORT` environment variable.
45
45
 
46
+ ### Auto-reloading application code in Rails
47
+
48
+ If properly configured, rspec-daemon will automatically reload your application code (you probably want this behavior).
49
+ Add the following code to `config/initializers/rspec_daemon.rb`:
50
+
51
+ ```ruby
52
+ # rspec-daemon exposes RSPEC_DAEMON=1
53
+ if Rails.env.test? && ENV['RSPEC_DAEMON']
54
+ Rails.configuration.enable_reloading = true
55
+ end
56
+ ```
57
+
58
+ If autoreloading is not configured, you'd need to restart `rspec-daemon` every time you change code under `app/`.
59
+ Spec code (under `spec/`) will be always reloaded regardless of this setting.
60
+
46
61
  ## Editor integration
47
62
 
48
63
  ### Vim/Neovim
data/exe/rspeccc CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'rspec/daemon/client_cli'
4
- exit RSpec::Daemon::ClientCli.run(ARGV)
4
+ exit RSpec::Daemon::ClientCli.start(ARGV)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  class Daemon
5
- VERSION = "1.0.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
data/lib/rspec/daemon.rb CHANGED
@@ -64,14 +64,22 @@ module RSpec
64
64
  RSpec.reset
65
65
 
66
66
  if cached_config.has_recorded_config?
67
+ # Reload configuration from the first time
67
68
  cached_config.replay_configuration
69
+ # Invoke auto reload
70
+ if defined?(::Rails) && ::Rails.configuration.reloading_enabled?
71
+ puts "Reloading..."
72
+ ::Rails.autoloaders.main.reload
73
+ end
68
74
  else
75
+ # This is the first spec run
69
76
  cached_config.record_configuration(&rspec_configuration)
70
77
  end
71
78
  end
72
79
 
73
80
  def rspec_configuration
74
81
  proc do
82
+ ENV['RSPEC_DAEMON'] = "1"
75
83
  if File.exist? "spec/rails_helper.rb"
76
84
  require "rails_helper"
77
85
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Fujiwara
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2023-12-15 00:00:00.000000000 Z
@@ -74,7 +74,7 @@ metadata:
74
74
  homepage_uri: https://github.com/asonas/rspec-daemon
75
75
  source_code_uri: https://github.com/asonas/rspec-daemon
76
76
  changelog_uri: https://github.com/asonas/rspec-daemon/blob/master/CHANGELOG.md
77
- post_install_message:
77
+ post_install_message:
78
78
  rdoc_options: []
79
79
  require_paths:
80
80
  - lib
@@ -89,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.4.6
93
- signing_key:
92
+ rubygems_version: 3.4.10
93
+ signing_key:
94
94
  specification_version: 4
95
95
  summary: rspec-daemon is a mechanism to run tests at super faster speed
96
96
  test_files: []