spec/unit/chef/sugar/platform_spec.rb in chef-sugar-3.1.1 vs spec/unit/chef/sugar/platform_spec.rb in chef-sugar-3.2.0

- old
+ new

@@ -133,9 +133,45 @@ node = { 'platform' => 'windows' } expect(described_class.omnios?(node)).to be false end end + describe '#raspbian?' do + it 'returns true when platform is raspbian' do + node = { 'platform' => 'raspbian' } + expect(described_class.raspbian?(node)).to be true + end + + it 'returns false when the platform is not raspbian' do + node = { 'platform' => 'windows' } + expect(described_class.raspbian?(node)).to be false + end + end + + describe '#nexus' do + it 'returns true when the platform is nexus' do + node = { 'platform' => 'nexus' } + expect(described_class.nexus?(node)).to be true + end + + it 'returns false when the platform is not nexus' do + node = { 'platform' => 'windows' } + expect(described_class.nexus?(node)).to be false + end + end + + describe '#ios_xr' do + it 'returns true when the platform is ios_xr' do + node = { 'platform' => 'ios_xr' } + expect(described_class.ios_xr?(node)).to be true + end + + it 'returns false when the platform is not ios_xr' do + node = { 'platform' => 'windows' } + expect(described_class.ios_xr?(node)).to be false + end + end + context 'dynamic matchers' do describe '#ubuntu_after_lucid?' do it 'returns true when the version is later than 10.04' do node = { 'platform' => 'ubuntu', 'platform_version' => '10.10' } expect(described_class.ubuntu_after_lucid?(node)).to be true