Skip to content

Commit

Permalink
Add missing test for WEBrick::HTTPAuth::Htgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
makenowjust committed Jun 23, 2018
1 parent 7b2c806 commit 541bd4d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/webrick/test_htgroup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require "tempfile"
require "test/unit"
require "webrick/httpauth/htgroup"

class TestHtgroup < Test::Unit::TestCase
def test_htgroup
Tempfile.create('test_htgroup') do |tmpfile|
tmpfile.close
tmp_group = WEBrick::HTTPAuth::Htgroup.new(tmpfile.path)
tmp_group.add 'superheroes', %w[spiderman batman]
tmp_group.add 'supervillains', %w[joker]
tmp_group.flush

htgroup = WEBrick::HTTPAuth::Htgroup.new(tmpfile.path)
assert_equal(htgroup.members('superheroes'), %w[spiderman batman])
assert_equal(htgroup.members('supervillains'), %w[joker])
end
end
end

0 comments on commit 541bd4d

Please sign in to comment.