Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonywoo committed Aug 7, 2023
1 parent d12fc3b commit 4d63142
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/kubernetes/test/models/kubernetes/util_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,14 @@
output[0].must_equal('name' => 'foo', 'value' => 999)
output[1].must_equal('name' => 'other_key', 'value' => 1000, 'password' => 12345)
end

it 'only loads allowed classes' do
yaml_input = <<~YAML
---
- !ruby/object:Gem::Installer
i: x
YAML
assert_raises(Psych::DisallowedClass) { Kubernetes::Util.parse_file(yaml_input, 'file.yaml') }
end
end
end

0 comments on commit 4d63142

Please sign in to comment.