diff options
author | Tim Smith <tsmith@chef.io> | 2019-11-22 19:38:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-22 19:38:44 -0800 |
commit | 48c85ea6c84bb51d20be8ed0d67c1353fad16f28 (patch) | |
tree | fe75236dc7e9fc39fae67fb520848817e5d878c6 /spec | |
parent | 4c24064f3531f9cee85ee61757cc3bd753fc272d (diff) | |
parent | 6c6de0511039f1c64e83802e98de4eae3550ebad (diff) | |
download | ohai-48c85ea6c84bb51d20be8ed0d67c1353fad16f28.tar.gz |
Merge pull request #1412 from AmazeCom/fixes-for-ruby27
Fix failures under Ruby 2.7
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/mixin/network_helper_spec.rb | 30 | ||||
-rw-r--r-- | spec/unit/plugins/aix/network_spec.rb | 10 |
2 files changed, 30 insertions, 10 deletions
diff --git a/spec/unit/mixin/network_helper_spec.rb b/spec/unit/mixin/network_helper_spec.rb new file mode 100644 index 00000000..ec0b2472 --- /dev/null +++ b/spec/unit/mixin/network_helper_spec.rb @@ -0,0 +1,30 @@ +# +# Author:: Kris Shannon <k.shannon@amaze.com.au> +# Copyright:: Copyright (c) 2019 Amaze Communication. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require "spec_helper" +require "ohai/mixin/network_helper" + +describe Ohai::Mixin::NetworkHelper, "Network Helper Mixin" do + let(:mixin) { Object.new.extend(Ohai::Mixin::NetworkHelper) } + + describe "hex_to_dec_netmask method" do + it "converts a netmask from hexadecimal form to decimal form" do + expect(mixin.hex_to_dec_netmask("ffff0000")).to eq("255.255.0.0") + end + end +end diff --git a/spec/unit/plugins/aix/network_spec.rb b/spec/unit/plugins/aix/network_spec.rb index a290e48a..e96db800 100644 --- a/spec/unit/plugins/aix/network_spec.rb +++ b/spec/unit/plugins/aix/network_spec.rb @@ -300,14 +300,4 @@ describe Ohai::System, "AIX network plugin" do expect(@plugin["network"]["arp"][0][:remote_mac]).to eq("6e:87:70:0:40:3") end end - - describe "hex_to_dec_netmask method" do - before do - @plugin.run - end - - it "converts a netmask from hexadecimal form to decimal form" do - expect(@plugin.hex_to_dec_netmask("0xffff0000")).to eq("255.255.0.0") - end - end end |