[前][次][番号順一覧][スレッド一覧]

ruby-changes:52002

From: hsbt <ko1@a...>
Date: Tue, 7 Aug 2018 21:56:56 +0900 (JST)
Subject: [ruby-changes:52002] hsbt:r64216 (trunk): Add missing test for WEBrick::HTTPAuth::Htgroup.

hsbt	2018-08-07 21:56:48 +0900 (Tue, 07 Aug 2018)

  New Revision: 64216

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64216

  Log:
    Add missing test for WEBrick::HTTPAuth::Htgroup.
    
      [Bug #14866][ruby-core:87602]
    
      https://github.com/ruby/webrick/pull/10
    
      Co-authored-by: TSUYUSATO Kitsune <make.just.on@g...>

  Added files:
    trunk/test/webrick/test_htgroup.rb
Index: test/webrick/test_htgroup.rb
===================================================================
--- test/webrick/test_htgroup.rb	(nonexistent)
+++ test/webrick/test_htgroup.rb	(revision 64216)
@@ -0,0 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/test/webrick/test_htgroup.rb#L1
+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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]