Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-chttpd/pull/10#discussion_r21087513
  
    --- Diff: test/chttpd_handler_reload_test.erl ---
    @@ -0,0 +1,111 @@
    +% Licensed under the Apache License,  Version 2.0 (the "License");  you 
may not
    +% use this file except in compliance with the License. You may obtain a 
copy of
    +% the License at
    +%
    +%                 http://www.apache.org/licenses/LICENSE-2.0
    +%
    +% Unless  required  by  applicable  law  or  agreed  to  in  writing,  
software
    +% distributed  under the  License  is distributed on an "AS IS" BASIS,  
WITHOUT
    +% WARRANTIES  OR  CONDITIONS  OF  ANY  KIND, either express or implied. 
See the
    +% License for the specific language governing permissions and limitations 
under
    +% the License.
    +
    +-module(chttpd_handler_reload_test).
    +
    +-compile(export_all).
    +
    +-include_lib("eunit/include/eunit.hrl").
    +
    +%% for testing
    +
    +a() -> a.
    +b() -> b.
    +c() -> c.
    +d() -> d.
    +e() -> e.
    +f() -> f.
    +g() -> g.
    +h() -> h.
    +
    +-spec reload_test() -> ok.
    +%% @doc verifies that there are no side effects from prior builds.
    +reload_test() ->
    --- End diff --
    
    As I can see the code, you can put firing up cluster into setup/teardown 
functions and using for/3 apply it over the cases you have there:
    - check endpoint by exact name ("A" and "B")
    - check endpoint by any name ('_' case)
    - find 1 and 2 in list (not sure what the case is described there)
    - check that endpoints could be overridden correctly
    - check that list things could be overridden correctly
    
    So at least there are 5 different cases in the single function. And if 
someone will broke up it would be easy to track the problem down and fix it 
without touching other cases.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to