Skip to content

Commit ec3517d

Browse files
Fix: Simplify rsc_support_enabled? method and update related tests
1 parent c39127c commit ec3517d

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

react_on_rails_pro/lib/react_on_rails_pro/utils.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ def self.react_server_client_manifest_file_path
4848
end
4949

5050
def self.rsc_support_enabled?
51-
return @rsc_support_enabled if defined?(@rsc_support_enabled)
52-
53-
rorp_config = ReactOnRailsPro.configuration
54-
@rsc_support_enabled = rorp_config.respond_to?(:enable_rsc_support) && !!rorp_config.enable_rsc_support
51+
ReactOnRailsPro.configuration.enable_rsc_support
5552
end
5653

5754
# Validates the license and raises an exception if invalid.

react_on_rails_pro/spec/react_on_rails_pro/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
Dir[File.join(__dir__, "support", "**", "*.rb")].each { |f| require f }
4444

4545
RSpec.configure do |config|
46+
Rails.logger = Logger.new($stdout)
4647
config.example_status_persistence_file_path = "spec/examples.txt"
4748
config.run_all_when_everything_filtered = true
4849

react_on_rails_pro/spec/react_on_rails_pro/utils_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ module ReactOnRailsPro
226226
context "when RSC support is enabled" do
227227
before do
228228
allow(ReactOnRailsPro.configuration).to receive(:enable_rsc_support).and_return(true)
229-
described_class.instance_variable_set(:@rsc_support_enabled, nil)
230229
end
231230

232231
it "returns true" do
@@ -237,7 +236,6 @@ module ReactOnRailsPro
237236
context "when RSC support is disabled" do
238237
before do
239238
allow(ReactOnRailsPro.configuration).to receive(:enable_rsc_support).and_return(false)
240-
described_class.instance_variable_set(:@rsc_support_enabled, nil)
241239
end
242240

243241
it "returns false" do

0 commit comments

Comments
 (0)