From c38bd0fa9405417eb4bbef1e161c980936dbc359 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Sun, 18 Oct 2026 09:29:16 -0400 Subject: [PATCH] Simplify public version assertions Assert the loaded version without hiding constants or reloading its assignment just for coverage. Correct the standalone-loading changelog claim. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 2 +- spec/lib/mongo_session_store/version_spec.rb | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10311ee..d248a62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ### 3.2.3 (Next) -* [#57](https://github.com/mongoid/mongo_session_store/pull/57): Cover legacy session decoding and version loading, and fix private decoder delegation in the plain-driver adapter - [@dblock](https://github.com/dblock). +* [#57](https://github.com/mongoid/mongo_session_store/pull/57): Cover legacy session decoding and fix private decoder delegation in the plain-driver adapter - [@dblock](https://github.com/dblock). * [#55](https://github.com/mongoid/mongo_session_store/pull/55): Add explicit bulk stale-session cleanup with an application-selected cutoff for both adapters - [@dblock](https://github.com/dblock). * [#54](https://github.com/mongoid/mongo_session_store/pull/54): Document and test storing permitted parameter hashes rather than request-bearing Rails parameter objects in sessions - [@dblock](https://github.com/dblock). * [#53](https://github.com/mongoid/mongo_session_store/pull/53): Cover Rails 6.1 through 8.0 in CI, update RuboCop, isolate Danger permissions, and report both adapters' coverage to Coveralls - [@dblock](https://github.com/dblock). diff --git a/spec/lib/mongo_session_store/version_spec.rb b/spec/lib/mongo_session_store/version_spec.rb index 581d0d9..b173948 100644 --- a/spec/lib/mongo_session_store/version_spec.rb +++ b/spec/lib/mongo_session_store/version_spec.rb @@ -1,13 +1,8 @@ require "spec_helper" -describe "Version entry point" do - it "defines a frozen semantic version when loaded on its own" do - hide_const("MongoSessionStore::VERSION") - load File.expand_path("../../../lib/mongo_session_store/version.rb", __dir__) - +describe MongoSessionStore do + it "defines a frozen semantic version" do expect(MongoSessionStore::VERSION).to match(/\A\d+\.\d+\.\d+\z/) expect(MongoSessionStore::VERSION).to be_frozen - ensure - MongoSessionStore.send(:remove_const, :VERSION) if MongoSessionStore.const_defined?(:VERSION) end end