Skip to content

Commit 9f5c1db

Browse files
authored
Merge pull request #2525 from mhashizume/FACT-3154/main/ruby_3_2
(FACT-3154) Adds Ruby 3.2 to rspec tests
2 parents 33db20f + 2c5e35f commit 9f5c1db

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.github/workflows/unit_tests.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- '2.3'
2222
- '2.7'
2323
- '3.0'
24-
- '3.1'
24+
- '3.2.0-preview2'
2525
- 'jruby-9.3.7.0'
2626
runs-on: ubuntu-latest
2727
steps:
@@ -38,6 +38,12 @@ jobs:
3838
- run: bundle exec rake spec_integration
3939

4040
windows_unit_tests:
41+
name: Windows tests with Ruby ${{ matrix.ruby }}
42+
strategy:
43+
matrix:
44+
ruby:
45+
- '2.7'
46+
- '3.1'
4147
runs-on: windows-2019
4248
steps:
4349
- name: Checkout current PR
@@ -46,7 +52,7 @@ jobs:
4652
- name: Rspec checks
4753
uses: ruby/setup-ruby@v1
4854
with:
49-
ruby-version: 2.7
55+
ruby-version: ${{ matrix.ruby }}
5056
- run: gem update bundler
5157
- run: bundle install --jobs 3 --retry 3
5258
- run: bundle exec rake spec_random

lib/facter/util/linux/socket_parser.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def mac_from(ifaddr)
8888
end
8989
rescue StandardError => e
9090
@log.debug("Could not read mac for interface #{ifaddr.name}, got #{e}")
91+
nil
9192
end
9293

9394
def mac_from_sockaddr_of(ifaddr)

spec/custom_facts/util/directory_loader_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
it "does nothing bad when dir doesn't exist" do
1717
fakepath = '/foobar/path'
1818
my_loader = LegacyFacter::Util::DirectoryLoader.new(fakepath)
19-
allow(FileTest).to receive(:exists?).with(my_loader.directories[0]).and_return(false)
19+
allow(FileTest).to receive(:exist?).with(my_loader.directories[0]).and_return(false)
2020
expect { my_loader.load(collection) }.not_to raise_error
2121
end
2222

spec/custom_facts/util/parser_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ def expects_to_parse_powershell(cmd, result)
354354
let(:yaml_content) { load_fixture('external_fact_yaml_date').read }
355355

356356
it 'loads date' do
357+
pending 'There is a bug in newer versions of Psych and Timecop' if RUBY_VERSION =~ /^3\.2/
357358
expected_result = { 'testsfact' => { 'date' => Date.parse('2020-04-28') } }
358359

359360
expect(yaml_parser.parse_results).to eq(expected_result)

0 commit comments

Comments
 (0)