Commit graph

1209 commits

Author SHA1 Message Date
Michael Miller
9294599440 Basic to_s for stubs 2019-11-03 11:59:12 -07:00
Michael Miller
d1b54ad48f Better error for when stubs don't match return type 2019-11-03 11:56:04 -07:00
Michael Miller
e6c1a6b2d2 Fix arg passing and implement arg matching 2019-11-03 11:42:31 -07:00
Michael Miller
1756670710 Add to_s method 2019-11-03 11:42:07 -07:00
Michael Miller
477271d297 Use NilMethodStub by default
Provides one place that #with can be defined and enforces ordering.
2019-11-03 11:23:04 -07:00
Michael Miller
af9104dfe4 Store arguments in method stub
Needed for matching arguments (setting constraints).
2019-11-03 11:18:46 -07:00
Michael Miller
20b80cc85a Formatting 2019-11-03 10:07:32 -07:00
Michael Miller
cab9366fe8 Merge branch 'dev/mocks-and-doubles' of gitlab.com:arctic-fox/spectator into dev/mocks-and-doubles 2019-11-03 10:07:11 -07:00
Michael Miller
3931f420fe Formatting 2019-11-03 10:03:09 -07:00
Michael Miller
5b143cb72c Change structure around 2019-11-03 10:02:53 -07:00
Michael Miller
c95e228bde Move mocks to their own module 2019-11-03 09:44:32 -07:00
Michael Miller
0c7de3d0d1 Merge branch 'dev/mocks-and-doubles' of gitlab.com:arctic-fox/spectator into dev/mocks-and-doubles 2019-11-02 19:58:56 -06:00
Michael Miller
42aaae7908 Some initial work on mocks 2019-11-02 19:58:47 -06:00
Michael Miller
541dc661ca Only accept exact parameters, don't use splats 2019-11-02 09:45:34 -06:00
Mike Miller
557d7d431a Merge branch 'super-inside-let-subject' into 'master'
Rework let and subject to allow super

See merge request arctic-fox/spectator!22
2019-10-25 03:00:00 +00:00
Michael Miller
af24e5c4cd Bump version to 0.8.4 2019-10-24 20:58:53 -06:00
Michael Miller
b95cf5693b Rework let and subject to allow super
This addresses https://gitlab.com/arctic-fox/spectator/issues/32
2019-10-24 20:56:22 -06:00
Michael Miller
e035afa85f Rework let and subject to allow super
This addresses https://gitlab.com/arctic-fox/spectator/issues/32
2019-10-24 20:47:48 -06:00
Michael Miller
3dd691a990 Record call to stub 2019-10-13 18:50:19 -06:00
Michael Miller
76fa7e294f Friendlier descriptions of objects 2019-10-13 18:49:22 -06:00
Michael Miller
d422376aaf Initial work on have_received matcher 2019-10-13 18:41:10 -06:00
Michael Miller
8cbe2edf30 Formatting 2019-10-13 17:36:55 -06:00
Michael Miller
b09898d131 Rename @stubs to @spectator_stubs 2019-10-13 11:36:31 -06:00
Michael Miller
3befc8001b Basics of stubbing is done
Still need to handle some features of yielding.
Also needs error handling.
2019-10-13 11:21:23 -06:00
Michael Miller
aecdb514b3 Implement basic and_return 2019-10-12 22:35:07 -06:00
Michael Miller
27bc976ae3 Try handling different method signatures and blocks 2019-10-12 21:30:20 -06:00
Michael Miller
211050650e Remove internal double class
Stub handling method should be called from nested methods.
2019-10-12 21:08:49 -06:00
Michael Miller
c80a28d616 More work on method stubs 2019-10-12 20:53:17 -06:00
Michael Miller
0b6465e6bc Started playing around with method stubs 2019-10-12 16:30:46 -06:00
Michael Miller
4b57ddab80 Handle changing test scope
This matches the current pattern, where a nested scope can override 
values from a parent scope.
I think this solution is quite clever :)
2019-10-06 11:12:06 -06:00
Michael Miller
6e50e54e05 Add HTML as planned output type 2019-10-06 11:02:52 -06:00
Michael Miller
1bbe5067b6 Handle deferred stub with type 2019-10-06 10:24:51 -06:00
Michael Miller
49764e5873 Use do...end for multi-line stub def 2019-10-05 22:43:40 -06:00
Michael Miller
6b85bb7ed7 Default raise if stub is called without defintion 2019-10-05 22:42:33 -06:00
Michael Miller
0528ddc2ab Handle stubbed methods with arguments 2019-10-05 22:22:31 -06:00
Michael Miller
47ca96801b Mark internal class as private
Minimal doubles should be done.
2019-10-05 22:06:03 -06:00
Michael Miller
00c0553426 Get contextual values working with doubles 2019-10-05 07:38:13 -06:00
Michael Miller
d08ec75db7 Minimal working double 2019-10-04 23:16:40 -06:00
Michael Miller
bff2668ad4 Remove old files 2019-10-04 23:16:22 -06:00
Michael Miller
c458a490bf Remove usage of sample values 2019-10-04 23:01:46 -06:00
Michael Miller
8c180e818f Merge remote-tracking branch 'origin/release/0.9' into mocks-and-doubles 2019-09-27 14:12:29 -06:00
Michael Miller
425240e66f Merge branch 'release/0.9' into mocks-and-doubles 2019-09-27 14:07:02 -06:00
Mike Miller
3666b0e02f Merge branch 'example-restructure' into 'release/0.9'
Example restructure

See merge request arctic-fox/spectator!20
2019-09-27 04:56:47 +00:00
Michael Miller
0e3727b504 Run after-all hooks correctly 2019-09-26 22:53:16 -06:00
Michael Miller
95fa9b39b2 Merge branch 'release/0.9' into example-restructure 2019-09-26 21:54:23 -06:00
Michael Miller
60ca4361de Fix implicit subject 2019-09-26 21:44:25 -06:00
Michael Miller
f47c48b483 Add pre- and post-conditions 2019-09-26 21:37:29 -06:00
Michael Miller
1eec9190dd Workaround for subject evaluation 2019-09-26 21:24:50 -06:00
Michael Miller
2c400950a4 Remove specs since they're mostly invalidated by the refactor 2019-09-26 20:52:26 -06:00
Michael Miller
07aeaecca4 Add support for pending tests 2019-09-26 20:46:28 -06:00