Skip to content

Commit

Permalink
fixup! make config frozen on initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenium committed Dec 7, 2024
1 parent bd2a7dd commit 1c08874
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/openssl/test_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_s_parse
assert_equal("[ default ]\n\n", c.to_s)
c = OpenSSL::Config.parse(@it.to_s)
assert_equal(['CA_default', 'ca', 'default'], c.sections.sort)
assert_predicate(c, :frozen?)
end

def test_s_parse_format
Expand Down Expand Up @@ -188,8 +189,7 @@ def test_initialize
c = OpenSSL::Config.new
assert_equal("", c.to_s)
assert_equal([], c.sections)
assert c.frozen?
assert c.dup.frozen?
assert_predicate(c, :frozen?)
end

def test_initialize_with_empty_file
Expand Down Expand Up @@ -270,8 +270,10 @@ def test_inspect
def test_dup
assert_equal(['CA_default', 'ca', 'default'], @it.sections.sort)
c1 = @it.dup
assert_predicate(c1, :frozen?)
assert_equal(@it.sections.sort, c1.sections.sort)
c2 = @it.clone
assert_predicate(c2, :frozen?)
assert_equal(@it.sections.sort, c2.sections.sort)
end

Expand Down

0 comments on commit 1c08874

Please sign in to comment.