Skip to content

Commit f1bc0fb

Browse files
committed
Improve Warning gem config, fix Ruby warning about ostruct
1 parent 1a5b38a commit f1bc0fb

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ gemspec
77

88
# Dev libs
99
gem 'appraisal', git: 'https://github.com/thoughtbot/appraisal.git'
10+
gem 'ostruct'
1011
gem 'pry'
1112
gem 'rake'
1213
gem 'rspec'

gemfiles/faraday0.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
source "https://rubygems.org"
44

55
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git"
6+
gem "ostruct"
67
gem "pry"
78
gem "rake"
89
gem "rspec"

gemfiles/faraday1.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
source "https://rubygems.org"
44

55
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git"
6+
gem "ostruct"
67
gem "pry"
78
gem "rake"
89
gem "rspec"

gemfiles/faraday2.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
source "https://rubygems.org"
44

55
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git"
6+
gem "ostruct"
67
gem "pry"
78
gem "rake"
89
gem "rspec"

spec/spec_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22

33
require 'warning'
44

5+
Warning[:deprecated] = true
6+
Warning[:performance] = true
7+
Warning[:experimental] = true
8+
59
# Ignore all warnings in Gem dependencies
610
Gem.path.each do |path|
711
Warning.ignore(//, path)
812
end
913

14+
# Ignore OpenStruct warning (only used in tests)
15+
Warning.ignore(/OpenStruct use is discouraged for performance reasons/)
16+
17+
# Load gem
1018
require 'netbox-client-ruby'
1119
require_relative 'shared_contexts/netbox_client'
1220
require_relative 'shared_contexts/faraday'
1321
require 'faraday/net_http_persistent' if Faraday::VERSION > '2'
1422

23+
# Configure rspec
1524
RSpec.configure do |config|
1625
config.example_status_persistence_file_path = '.rspec_status'
1726

0 commit comments

Comments
 (0)