couchdb-meck.git
15 months agoLeave module loaded state as it was upstream
Zsolt Laky [Mon, 15 Mar 2021 16:05:15 +0000 (17:05 +0100)] 
Leave module loaded state as it was

15 months agoAdd sponsorship link, remove build tool badge
Adam Lindberg [Sat, 6 Mar 2021 13:19:32 +0000 (14:19 +0100)] 
Add sponsorship link, remove build tool badge

15 months agoRemove deprecated app file field
Adam Lindberg [Sat, 6 Mar 2021 12:48:28 +0000 (13:48 +0100)] 
Remove deprecated app file field

15 months agoVersion 0.9.2 0.9.2
Adam Lindberg [Sat, 6 Mar 2021 12:40:55 +0000 (13:40 +0100)] 
Version 0.9.2

15 months agoAdd a further caveat to using `meck` with `ct`
Paulo F. Oliveira [Tue, 2 Mar 2021 16:06:01 +0000 (16:06 +0000)] 
Add a further caveat to using `meck` with `ct`

15 months agoAdd OTP 24 to build matrix
Adam Lindberg [Wed, 3 Mar 2021 12:28:57 +0000 (13:28 +0100)] 
Add OTP 24 to build matrix

15 months agoFix a dialyzer-issued warning
Paulo F. Oliveira [Sat, 6 Feb 2021 02:49:59 +0000 (02:49 +0000)] 
Fix a dialyzer-issued warning

16 months agoVersion 0.9.1 0.9.1
Adam Lindberg [Fri, 19 Feb 2021 14:20:56 +0000 (15:20 +0100)] 
Version 0.9.1

16 months agoRemove unused chandler tool from cut script check
Adam Lindberg [Wed, 17 Feb 2021 14:44:25 +0000 (15:44 +0100)] 
Remove unused chandler tool from cut script check

16 months agoAdd to changelog
Adam Lindberg [Wed, 17 Feb 2021 14:38:16 +0000 (15:38 +0100)] 
Add to changelog

Fixed tense on unreleased changelog items.

16 months agoRename module name in type specs
Adam Lindberg [Wed, 17 Feb 2021 11:52:00 +0000 (12:52 +0100)] 
Rename module name in type specs

Fixes #206.

16 months agoUse Unite for EUnit tests
Adam Lindberg [Wed, 17 Feb 2021 11:37:02 +0000 (12:37 +0100)] 
Use Unite for EUnit tests

Enables better printout of test output.

16 months agoClarify and fix example of passthrough/1
Adam Lindberg [Wed, 17 Feb 2021 10:39:51 +0000 (11:39 +0100)] 
Clarify and fix example of passthrough/1

Example was no longer working on newer Erlang versions because the shell used the string module while being mocked. Adding the passthrough options solved this. Also added an actual example of using the passthrough/1 function in only some clauses. Fixes #224

17 months agoCorrect type spec for do_delete_expect/6
Adam Lindberg [Wed, 20 Jan 2021 12:14:22 +0000 (13:14 +0100)] 
Correct type spec for do_delete_expect/6

17 months agoAim for repeatability
Paulo F. Oliveira [Thu, 3 Dec 2020 14:57:30 +0000 (14:57 +0000)] 
Aim for repeatability

17 months agoImagine this is a possible solution to a past requirement
Paulo F. Oliveira [Wed, 18 Nov 2020 23:01:06 +0000 (23:01 +0000)] 
Imagine this is a possible solution to a past requirement

17 months agoBroaden our check/test scope
Paulo F. Oliveira [Wed, 18 Nov 2020 22:57:20 +0000 (22:57 +0000)] 
Broaden our check/test scope

17 months agoImprove repeatability
Paulo F. Oliveira [Wed, 18 Nov 2020 22:56:05 +0000 (22:56 +0000)] 
Improve repeatability

prod and check are not valid profiles, as per rebar.config

17 months agoFix static analysis (dialyzer) -identified issue
Paulo F. Oliveira [Wed, 18 Nov 2020 22:55:42 +0000 (22:55 +0000)] 
Fix static analysis (dialyzer) -identified issue

17 months agoBe stricter in our static analysis
Paulo F. Oliveira [Wed, 18 Nov 2020 22:55:26 +0000 (22:55 +0000)] 
Be stricter in our static analysis

17 months agoIsolate hamcrest elements from static analysis issues
Paulo F. Oliveira [Wed, 18 Nov 2020 22:55:08 +0000 (22:55 +0000)] 
Isolate hamcrest elements from static analysis issues

17 months agoChange order when adding new clauses
Zsolt Laky [Sat, 24 Oct 2020 08:44:35 +0000 (10:44 +0200)] 
Change order when adding new clauses

Do not recompile when passsthrough is set and non_strict is false

Refactor to comply to standards

Add test case

Optimize new expects creation

19 months agoFix static analysis issues
Paulo F. Oliveira [Wed, 18 Nov 2020 13:52:48 +0000 (13:52 +0000)] 
Fix static analysis issues

2 years agoDon't re-publish docs
Adam Lindberg [Thu, 25 Jun 2020 12:05:43 +0000 (14:05 +0200)] 
Don't re-publish docs

Docs are automatically published as part of rebar3 hex publish.

2 years agoVersion 0.9.0 0.9.0
Adam Lindberg [Thu, 25 Jun 2020 11:59:09 +0000 (13:59 +0200)] 
Version 0.9.0

2 years agoDon't push release changelog entries automatically
Adam Lindberg [Thu, 25 Jun 2020 11:58:17 +0000 (13:58 +0200)] 
Don't push release changelog entries automatically

2 years agoTransition to manual CHANGELOG
Adam Lindberg [Thu, 25 Jun 2020 11:50:22 +0000 (13:50 +0200)] 
Transition to manual CHANGELOG

2 years agoUpdate copyright year
Adam Lindberg [Thu, 25 Jun 2020 11:50:12 +0000 (13:50 +0200)] 
Update copyright year

2 years agoAdd exec/1 to documented list of functions to return a ret_spec
Jesper Eskilson [Thu, 25 Jun 2020 06:33:22 +0000 (08:33 +0200)] 
Add exec/1 to documented list of functions to return a ret_spec

2 years agoMake meck:ret_spec/0 transparent
Jesper Eskilson [Thu, 25 Jun 2020 06:25:33 +0000 (08:25 +0200)] 
Make meck:ret_spec/0 transparent

This is necessary to allow the "any term is a valid ret_spec" usage
pattern.

2 years agoUse compatible stack trace handling
Adam Lindberg [Thu, 14 May 2020 09:59:16 +0000 (11:59 +0200)] 
Use compatible stack trace handling

Moved and cleaned up the stack trace handling to a shared header file.
Cleaned-up file is developed by me and taken from basho/riak_core [1],
based on this original code in Meck.

[1]: https://github.com/basho/riak_core/blob/b726b0b4c5bbef1a20b95d551d3e32f6dc8741b5/src/stacktrace.hrl

2 years agoUpdate supported Erlang versions to 19-23
Adam Lindberg [Thu, 14 May 2020 08:29:52 +0000 (10:29 +0200)] 
Update supported Erlang versions to 19-23

2 years agoAdd compiler application to dependencies
Jake Breindel [Thu, 14 May 2020 08:23:56 +0000 (04:23 -0400)] 
Add compiler application to dependencies

PR #209

2 years agoRename foldl_mocks to fold_mocks
Adam Lindberg [Thu, 14 May 2020 08:16:55 +0000 (10:16 +0200)] 
Rename foldl_mocks to fold_mocks

Since the fold order is undeterministic because it relies on the order
return from erlang:registered(), there is no point in having the 'left'
component in the name.

2 years agoAdd introspection of which modules are currently mocked
Filipe Cristovao [Tue, 12 May 2020 20:13:51 +0000 (22:13 +0200)] 
Add introspection of which modules are currently mocked

There's already an `meck:expects/[1,2]`, allowing introspection into
what kind of expectations are set.
This allows one to also check which modules is meck handling at any
point.

Introduced a `foldl_mocks` internal function to reuse the same logic
for both `unload/0` and `mocked/0`

2 years agoRun CI on pull requests
Adam Lindberg [Wed, 13 May 2020 13:49:09 +0000 (15:49 +0200)] 
Run CI on pull requests

2 years agoUpdate funding with GitHub Sponsors link
Adam Lindberg [Mon, 27 Apr 2020 09:11:02 +0000 (11:11 +0200)] 
Update funding with GitHub Sponsors link

2 years agoUpdate badges to use GitHub Actions
Adam Lindberg [Wed, 5 Feb 2020 18:13:12 +0000 (19:13 +0100)] 
Update badges to use GitHub Actions

2 years agoAuto use latest versions of major OTP versions
Adam Lindberg [Wed, 5 Feb 2020 16:54:58 +0000 (17:54 +0100)] 
Auto use latest versions of major OTP versions

2 years agoAdd supported Erlang versions
Adam Lindberg [Wed, 5 Feb 2020 16:37:22 +0000 (17:37 +0100)] 
Add supported Erlang versions

2 years agoChange to matrix build
Adam Lindberg [Wed, 5 Feb 2020 16:33:34 +0000 (17:33 +0100)] 
Change to matrix build

2 years agoCreate first GitHub action
Adam Lindberg [Wed, 5 Feb 2020 16:24:21 +0000 (17:24 +0100)] 
Create first GitHub action

2 years agoDo not attempt to generate dependencies when mocking
Jesper Eskilson [Wed, 5 Feb 2020 12:35:42 +0000 (13:35 +0100)] 
Do not attempt to generate dependencies when mocking

Fixed in #207

2 years agoCreate FUNDING.yml
Adam Lindberg [Tue, 27 Aug 2019 12:19:08 +0000 (14:19 +0200)] 
Create FUNDING.yml

3 years ago Validate the options being passed to meck:new (#204)
Francois Brodeur [Thu, 21 Mar 2019 10:29:58 +0000 (06:29 -0400)] 
 Validate the options being passed to meck:new (#204)

* Validate the options being passed
* Add a new test for validate_options
* Fix a typo of passthrough option in a test case

3 years agoUpdate changelog for version 0.8.13
Adam Lindberg [Tue, 8 Jan 2019 10:27:58 +0000 (11:27 +0100)] 
Update changelog for version 0.8.13

3 years agoVersion 0.8.13 0.8.13
Adam Lindberg [Tue, 8 Jan 2019 10:27:14 +0000 (11:27 +0100)] 
Version 0.8.13

3 years agoExclude from_core option from compile_info when compiling
José Valim [Thu, 27 Dec 2018 13:25:16 +0000 (14:25 +0100)] 
Exclude from_core option from compile_info when compiling

Closes #201

3 years agoRefine Erlang versions
Adam Lindberg [Sun, 30 Dec 2018 14:16:11 +0000 (15:16 +0100)] 
Refine Erlang versions

3 years agoFix nofile errors caused by incorrect file lookup
Adam Lindberg [Sun, 30 Dec 2018 14:03:07 +0000 (15:03 +0100)] 
Fix nofile errors caused by incorrect file lookup

3 years agoIsolate backup *.coverdata from other beam instances
Daniel Sommermann [Wed, 24 Oct 2018 17:13:56 +0000 (10:13 -0700)] 
Isolate backup *.coverdata from other beam instances

If multiple beam instances are launched in parallel with the same current
working directory, it is possible for the backup cover data from one
instance to be squashed and deleted by other instances. By adding the OS
pid of beam.smp itself to the filename, we avoid this potential issue.

3 years agoFix Erlang version badge
Adam Lindberg [Mon, 8 Oct 2018 08:24:27 +0000 (10:24 +0200)] 
Fix Erlang version badge

3 years agoRemove compatibility for R15 and R16
Adam Lindberg [Mon, 8 Oct 2018 08:18:11 +0000 (10:18 +0200)] 
Remove compatibility for R15 and R16

Closes #198.

3 years agoUpdate changelog for version 0.8.12
Adam Lindberg [Wed, 8 Aug 2018 07:58:54 +0000 (09:58 +0200)] 
Update changelog for version 0.8.12

3 years agoVersion 0.8.12 0.8.12
Adam Lindberg [Wed, 8 Aug 2018 07:58:19 +0000 (09:58 +0200)] 
Version 0.8.12

3 years agoCheck path and push release with Chandler
Adam Lindberg [Wed, 8 Aug 2018 07:38:24 +0000 (09:38 +0200)] 
Check path and push release with Chandler

3 years agoKeep storing history when reloading a mock
Adam Lindberg [Wed, 8 Aug 2018 07:36:36 +0000 (09:36 +0200)] 
Keep storing history when reloading a mock

Fixes #194.

3 years agoMinor markdown improvements
Adam Lindberg [Thu, 12 Jul 2018 09:55:06 +0000 (11:55 +0200)] 
Minor markdown improvements

3 years agoUpdate changelog for version 0.8.11
Adam Lindberg [Thu, 12 Jul 2018 09:36:53 +0000 (11:36 +0200)] 
Update changelog for version 0.8.11

3 years agoVersion 0.8.11 0.8.11
Adam Lindberg [Thu, 12 Jul 2018 09:35:47 +0000 (11:35 +0200)] 
Version 0.8.11

3 years agoChange publish script to cut script
Adam Lindberg [Thu, 12 Jul 2018 09:35:00 +0000 (11:35 +0200)] 
Change publish script to cut script

3 years agoUse latest OTP 20 and 21 versions
Adam Lindberg [Thu, 12 Jul 2018 09:28:50 +0000 (11:28 +0200)] 
Use latest OTP 20 and 21 versions

3 years agoUpdate outdated donation information
Adam Lindberg [Wed, 11 Jul 2018 11:14:41 +0000 (13:14 +0200)] 
Update outdated donation information

3 years agofix a buggy spec
mats cronqvist [Wed, 11 Jul 2018 09:46:58 +0000 (11:46 +0200)] 
fix a buggy spec

3 years agoun-nest the `try' constructs
mats cronqvist [Wed, 11 Jul 2018 09:46:06 +0000 (11:46 +0200)] 
un-nest the `try' constructs

3 years agodon't hide 'try' behind macro
mats cronqvist [Tue, 10 Jul 2018 13:36:00 +0000 (15:36 +0200)] 
don't hide 'try' behind macro

3 years agouse some preproc trickery to hide the OTP21 get_stacktrace change
mats cronqvist [Wed, 4 Jul 2018 13:26:40 +0000 (15:26 +0200)] 
use some preproc trickery to hide the OTP21 get_stacktrace change

There is no good solution if you want BOTH
a) be able to compile with both pre- and post-21 compilers
b) no warning (e.g. if you use warnings_as_errors)
This is, hopefully, one of the less bad hacks.
We introduce the macro 'try_with_stack/1' which runs it's argument inside a
try. It returns either {ok, Result} or {Class, Reason, Stacktrace}.
The macro has two different implementations; post-21 (try catch C:R:S) and
pre-21 (get_stacktrace/0).
We use the 'OTP_RELEASE' directive, which was introduced in 21, to decide
between post- and pre-21.

3 years agofix some whitespace
mats cronqvist [Wed, 4 Jul 2018 13:25:26 +0000 (15:25 +0200)] 
fix some whitespace

3 years agoLine about 80 char line limit was 155 chars long
mats cronqvist [Wed, 4 Jul 2018 13:22:35 +0000 (15:22 +0200)] 
Line about 80 char line limit was 155 chars long

4 years agoUpdate Changelog for version 0.8.10
Adam Lindberg [Tue, 26 Jun 2018 07:01:13 +0000 (09:01 +0200)] 
Update Changelog for version 0.8.10

4 years agoVersion 0.8.10
Adam Lindberg [Tue, 26 Jun 2018 06:59:47 +0000 (08:59 +0200)] 
Version 0.8.10

4 years agoImprove publish script
Adam Lindberg [Tue, 26 Jun 2018 06:54:01 +0000 (08:54 +0200)] 
Improve publish script

4 years agotest meck with Erlang/OTP 21.0
Michal Piotrowski [Fri, 22 Jun 2018 12:55:05 +0000 (14:55 +0200)] 
test meck with Erlang/OTP 21.0

4 years agoAdd module name to module_is_sticky error
Adam Lindberg [Thu, 3 May 2018 16:29:01 +0000 (18:29 +0200)] 
Add module name to module_is_sticky error

4 years agoDocument undefined_module error
Adam Lindberg [Thu, 3 May 2018 16:27:36 +0000 (18:27 +0200)] 
Document undefined_module error

4 years agoRaise error for passthrough without abstract code
Adam Lindberg [Thu, 3 May 2018 16:25:57 +0000 (18:25 +0200)] 
Raise error for passthrough without abstract code

4 years agoAdd meck:expects/1,2 to list mocked functions
Brujo Benavides [Mon, 22 Jan 2018 15:30:45 +0000 (12:30 -0300)] 
Add meck:expects/1,2 to list mocked functions

PR #187 thanks to @elbrujohalcon and @miriampena

4 years agoSpecify repository manually for changelog gen
Adam Lindberg [Mon, 27 Nov 2017 12:01:08 +0000 (13:01 +0100)] 
Specify repository manually for changelog gen

4 years agoUpdate Changelog for version 0.8.9
Adam Lindberg [Mon, 27 Nov 2017 12:00:49 +0000 (13:00 +0100)] 
Update Changelog for version 0.8.9

4 years agoVersion 0.8.9 0.8.9
Adam Lindberg [Mon, 27 Nov 2017 11:57:31 +0000 (12:57 +0100)] 
Version 0.8.9

4 years agoSupport running meck with modules built with '+deterministic' compile option
Miika-Petteri Matikainen [Tue, 21 Nov 2017 06:56:46 +0000 (08:56 +0200)] 
Support running meck with modules built with '+deterministic' compile option

When modules are built with '+deterministic' option, the BEAM files
don't have compile options available in the module_info/1:

    $ cat foo.erl
    -module(foo).
    $ erlc foo.erl
    $ erl -noshell -eval 'io:format("~p~n", [foo:module_info(compile)])' -run init stop
    [{options,[]},
    {version,"7.1.1"},
    {source,"/home/foobar/foo.erl"}]
    $ rm foo.beam
    $ erlc +deterministic foo.erl
    $ erl -noshell -eval 'io:format("~p~n", [foo:module_info(compile)])' -run init stop
    [{version,"7.1.1"}]

Running meck against these modules fail:

    ::{function_clause,[{lists,'-filter/2-lc$^0/1-0-',
                               [undefined],
                               [{file,"lists.erl"},{line,1286}]},
                        {meck_proc,backup_original,3,
                                   [{file,"/home/foobar/meck/_build/default/lib/meck/src/meck_proc.erl"},
                                    {line,361}]},
                        {meck_proc,init,1,
                                   [{file,"/home/foobar/meck/_build/default/lib/meck/src/meck_proc.erl"},
                                    {line,206}]},
                        {gen_server,init_it,2,
                                    [{file,"gen_server.erl"},{line,365}]},
                        {gen_server,init_it,6,[{file,[...]},{line,...}]},
                        {proc_lib,init_p_do_apply,3,[{file,...},{...}]}]}

This commit fixes the problem.

Fixes https://github.com/eproxus/meck/issues/184

4 years agoFix for Rebar 2.x.y on secondary arches
Peter Lemenkov [Wed, 27 Sep 2017 14:04:42 +0000 (14:04 +0000)] 
Fix for Rebar 2.x.y on secondary arches

Erlang + Eunit + Rebar2 behaves differently on secondary arches (mips,
sh4, powerpc, and likely other BigEndian ones). Apparently we need to
specify setup and teardown procedures explicitly instead of copying
meck:new(...) followed by meck:unload() in every test of a suite. Don't
know why, but doing this won't hurt.

I cannot reproduce this issue with Rebar3.

Fixes #105.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
4 years agoUpdate README.md master
Adam Lindberg [Thu, 7 Sep 2017 08:23:54 +0000 (10:23 +0200)] 
Update README.md

4 years agoUpdate for latest version and Rebar 3
Adam Lindberg [Thu, 7 Sep 2017 08:21:00 +0000 (10:21 +0200)] 
Update for latest version and Rebar 3

4 years agoUpdate copyright notices
Adam Lindberg [Tue, 29 Aug 2017 12:30:30 +0000 (14:30 +0200)] 
Update copyright notices

4 years agoUpdate Changelog for version 0.8.8
Adam Lindberg [Tue, 29 Aug 2017 12:15:01 +0000 (14:15 +0200)] 
Update Changelog for version 0.8.8

4 years agoVersion 0.8.8 0.8.8
Adam Lindberg [Tue, 29 Aug 2017 12:10:10 +0000 (14:10 +0200)] 
Version 0.8.8

4 years agoAlways add debug_info to compile opts for mocks
Eric Entin [Tue, 25 Jul 2017 14:46:16 +0000 (10:46 -0400)] 
Always add debug_info to compile opts for mocks

5 years agoPublish docs to Hex when releasing
Adam Lindberg [Thu, 29 Jun 2017 13:21:34 +0000 (15:21 +0200)] 
Publish docs to Hex when releasing

5 years agoFixes to publish script
Adam Lindberg [Thu, 29 Jun 2017 13:13:58 +0000 (15:13 +0200)] 
Fixes to publish script

5 years agoUpdate Changelog for version 0.8.7
Adam Lindberg [Thu, 29 Jun 2017 13:13:13 +0000 (15:13 +0200)] 
Update Changelog for version 0.8.7

5 years agoFix syntax error in .app.src 0.8.7
Adam Lindberg [Thu, 29 Jun 2017 13:10:43 +0000 (15:10 +0200)] 
Fix syntax error in .app.src

5 years agoVersion 0.8.7
Adam Lindberg [Thu, 29 Jun 2017 13:09:00 +0000 (15:09 +0200)] 
Version 0.8.7

5 years agoUpdate publish script
Adam Lindberg [Thu, 29 Jun 2017 13:06:15 +0000 (15:06 +0200)] 
Update publish script

5 years agoAdd Changelog to Hex.pm links
Adam Lindberg [Thu, 29 Jun 2017 12:58:00 +0000 (14:58 +0200)] 
Add Changelog to Hex.pm links

5 years agoUpdate Hex package information for Rebar 3
Adam Lindberg [Thu, 29 Jun 2017 12:47:18 +0000 (14:47 +0200)] 
Update Hex package information for Rebar 3

5 years agoAdd GitHub Changelog Generator config
Adam Lindberg [Thu, 29 Jun 2017 12:38:31 +0000 (14:38 +0200)] 
Add GitHub Changelog Generator config

5 years agoCreate new CHANGELOG.md
Adam Lindberg [Thu, 29 Jun 2017 10:08:16 +0000 (12:08 +0200)] 
Create new CHANGELOG.md

This is using the github_changelog_generator available at
https://github.com/skywinder/github-changelog-generator.

5 years agoMigrate to Rebar 3
Adam Lindberg [Thu, 2 Feb 2017 09:02:32 +0000 (10:02 +0100)] 
Migrate to Rebar 3

This change expects Meck to be built with Rebar 3 from now on. Due to it
not being compatible with Rebar 3, the optional dependency on Hamcrest
has been removed. Meck still supports matchers so it should still be
compatible, but it is no longer tested.

5 years agoVersion 0.8.6 0.8.6
Adam Lindberg [Wed, 28 Jun 2017 09:31:32 +0000 (11:31 +0200)] 
Version 0.8.6