Skip to content

Commit 41fdb43

Browse files
authored
Remove ostruct as a runtime dependency (#20)
ostruct was only used in a single spec helper to mock Rails.application. Replace the OpenStruct mock with an RSpec double and drop the gem dependency from the gemspec and lockfile.
1 parent 03d1845 commit 41fdb43

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

Gemfile.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ PATH
33
specs:
44
bigrails-redis (0.7.2)
55
activesupport (>= 6)
6-
ostruct
76
railties (>= 6)
87
redis (>= 4)
98

@@ -79,7 +78,6 @@ GEM
7978
racc (~> 1.4)
8079
nokogiri (1.16.5-x86_64-linux)
8180
racc (~> 1.4)
82-
ostruct (0.6.3)
8381
parallel (2.1.0)
8482
parser (3.3.11.1)
8583
ast (~> 2.4.1)

bigrails-redis.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
2222
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2323

2424
spec.add_dependency "activesupport", ">= 6"
25-
spec.add_dependency "ostruct"
2625
spec.add_dependency "railties", ">= 6"
2726
spec.add_dependency "redis", ">= 4"
2827
end

spec/support/fixtures.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# frozen_string_literal: true
22

33
require "pathname"
4-
require "ostruct"
54

65
module Spec
76
module Support
87
module Fixtures
98
def load_config(type)
10-
allow(Rails).to receive(:application).and_return(
11-
OpenStruct.new(paths: {
12-
"config" => [Pathname.new("spec/fixtures/#{type}").expand_path]
13-
})
14-
)
9+
paths = {
10+
"config" => [Pathname.new("spec/fixtures/#{type}").expand_path]
11+
}
12+
application = double("Rails.application", paths: paths)
13+
allow(Rails).to receive(:application).and_return(application)
1514
end
1615
end
1716
end

0 commit comments

Comments
 (0)