couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxepal <...@git.apache.org>
Subject [GitHub] couchdb pull request: Replace etap tests with eunit
Date Mon, 14 Jul 2014 22:39:38 GMT
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/253#discussion_r14908681
  
    --- Diff: test/couchdb/couch_file_tests.erl ---
    @@ -0,0 +1,265 @@
    +% 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(couch_file_tests).
    +
    +-include("couch_eunit.hrl").
    +
    +-define(BLOCK_SIZE, 4096).
    +-define(setup(F), {setup, fun setup/0, fun teardown/1, F}).
    +-define(foreach(Fs), {foreach, fun setup/0, fun teardown/1, Fs}).
    +
    +
    +setup() ->
    +    {ok, Fd} = couch_file:open(?tempfile(), [create, overwrite]),
    +    Fd.
    +
    +teardown(Fd) ->
    +    ok = couch_file:close(Fd).
    +
    +
    +open_close_test_() ->
    +    {
    +        "Test for proper file open and close",
    +        [
    +            should_return_enoent_if_missed(),
    +            should_ignore_invalid_flags_with_open(),
    +            ?setup(fun should_return_pid_on_file_open/1),
    +            should_close_file_properly(),
    +            ?setup(fun should_create_empty_new_files/1)
    +        ]
    --- End diff --
    
    Because these tests doesn't need in setup/teardown context, but still belongs to the same
suite?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message