assert 2.16.5 → 2.18.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/Gemfile +3 -1
- data/README.md +79 -54
- data/assert.gemspec +6 -5
- data/bin/assert +4 -4
- data/lib/assert.rb +8 -18
- data/lib/assert/actual_value.rb +127 -0
- data/lib/assert/assert_runner.rb +7 -10
- data/lib/assert/assertions.rb +15 -28
- data/lib/assert/cli.rb +41 -57
- data/lib/assert/config.rb +8 -12
- data/lib/assert/config_helpers.rb +6 -10
- data/lib/assert/context.rb +30 -24
- data/lib/assert/context/let_dsl.rb +13 -0
- data/lib/assert/context/method_missing.rb +19 -0
- data/lib/assert/context/setup_dsl.rb +0 -4
- data/lib/assert/context/subject_dsl.rb +0 -4
- data/lib/assert/context/suite_dsl.rb +0 -4
- data/lib/assert/context/test_dsl.rb +5 -9
- data/lib/assert/context_info.rb +2 -6
- data/lib/assert/default_runner.rb +1 -5
- data/lib/assert/default_suite.rb +1 -6
- data/lib/assert/default_view.rb +8 -12
- data/lib/assert/factory.rb +1 -4
- data/lib/assert/file_line.rb +0 -4
- data/lib/assert/macro.rb +1 -4
- data/lib/assert/macros/methods.rb +5 -11
- data/lib/assert/result.rb +19 -34
- data/lib/assert/runner.rb +12 -11
- data/lib/assert/stub.rb +16 -2
- data/lib/assert/suite.rb +3 -7
- data/lib/assert/test.rb +13 -18
- data/lib/assert/utils.rb +8 -12
- data/lib/assert/version.rb +1 -1
- data/lib/assert/view.rb +18 -21
- data/lib/assert/view_helpers.rb +6 -17
- data/log/{.gitkeep → .keep} +0 -0
- data/test/helper.rb +26 -41
- data/test/support/factory.rb +20 -6
- data/test/support/inherited_stuff.rb +0 -2
- data/test/system/stub_tests.rb +350 -354
- data/test/system/test_tests.rb +119 -133
- data/test/unit/actual_value_tests.rb +335 -0
- data/test/unit/assert_tests.rb +125 -52
- data/test/unit/assertions/assert_block_tests.rb +34 -37
- data/test/unit/assertions/assert_empty_tests.rb +38 -38
- data/test/unit/assertions/assert_equal_tests.rb +84 -86
- data/test/unit/assertions/assert_file_exists_tests.rb +37 -39
- data/test/unit/assertions/assert_includes_tests.rb +45 -46
- data/test/unit/assertions/assert_instance_of_tests.rb +39 -40
- data/test/unit/assertions/assert_kind_of_tests.rb +39 -40
- data/test/unit/assertions/assert_match_tests.rb +39 -40
- data/test/unit/assertions/assert_nil_tests.rb +35 -38
- data/test/unit/assertions/assert_raises_tests.rb +58 -62
- data/test/unit/assertions/assert_respond_to_tests.rb +41 -42
- data/test/unit/assertions/assert_same_tests.rb +94 -90
- data/test/unit/assertions/assert_true_false_tests.rb +67 -69
- data/test/unit/assertions_tests.rb +17 -19
- data/test/unit/config_helpers_tests.rb +41 -43
- data/test/unit/config_tests.rb +42 -46
- data/test/unit/context/let_dsl_tests.rb +10 -0
- data/test/unit/context/setup_dsl_tests.rb +72 -91
- data/test/unit/context/subject_dsl_tests.rb +18 -51
- data/test/unit/context/suite_dsl_tests.rb +19 -23
- data/test/unit/context/test_dsl_tests.rb +52 -59
- data/test/unit/context_info_tests.rb +19 -21
- data/test/unit/context_tests.rb +175 -178
- data/test/unit/default_runner_tests.rb +4 -10
- data/test/unit/default_suite_tests.rb +54 -59
- data/test/unit/factory_tests.rb +6 -9
- data/test/unit/file_line_tests.rb +34 -40
- data/test/unit/macro_tests.rb +11 -20
- data/test/unit/result_tests.rb +156 -182
- data/test/unit/runner_tests.rb +72 -79
- data/test/unit/suite_tests.rb +62 -63
- data/test/unit/test_tests.rb +143 -147
- data/test/unit/utils_tests.rb +49 -62
- data/test/unit/view_helpers_tests.rb +67 -70
- data/test/unit/view_tests.rb +26 -32
- metadata +54 -47
- data/.assert.rb +0 -3
- data/.gitignore +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
SHA512:
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ff0d6ff9233adc09dda972e165c47c125e158e46b0329b927eb7de201ddebf65
|
4
|
+
data.tar.gz: 8f77b5326cf44e2ed0c7ed72cac390a7147191634354feb2b890f73d572b366f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 25b58fd65c099c0c9f8ff16a652e28d5baeae76838b640872224abd7d063759d6fd40b3ec927220260d82321f78cc4b7617d50a081c7ba336b04d45acec8f618
|
7
|
+
data.tar.gz: 669749ff845ae1811802042dd28e27e7a387d9d39a9504d73b8b04667c9597c4da08bd56cc26a7b34838e5afde2970215027a7d3967ad1e7f99175c62c49a08e
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -5,14 +5,12 @@
|
|
5
5
|
```ruby
|
6
6
|
# in test/my_tests.rb
|
7
7
|
|
8
|
-
require
|
8
|
+
require "assert"
|
9
9
|
|
10
10
|
class MyTests < Assert::Context
|
11
|
-
|
12
11
|
test "something" do
|
13
|
-
|
12
|
+
assert_that(1).equals(1)
|
14
13
|
end
|
15
|
-
|
16
14
|
end
|
17
15
|
```
|
18
16
|
|
@@ -35,13 +33,13 @@ Running tests in random order, seeded with "56382"
|
|
35
33
|
|
36
34
|
## What Assert is not
|
37
35
|
|
38
|
-
* **RSpec/spec-anything**: define tests using assertion statements
|
39
|
-
* **Unit/Functional/Integration/etc**: Assert is agnostic - you define whatever kinds of tests you like
|
40
|
-
* **Mock/Spec/BDD/etc**: Assert is the framework and there are a variety of 3rd party tools to do such things
|
36
|
+
* **RSpec/spec-anything**: define tests using assertion statements.
|
37
|
+
* **Unit/Functional/Integration/etc**: Assert is agnostic - you define whatever kinds of tests you like and Assert runs them in context.
|
38
|
+
* **Mock/Spec/BDD/etc**: Assert is the framework and there are a variety of 3rd party tools to do such things. Feel free to use whatever you like.
|
41
39
|
|
42
40
|
## Description
|
43
41
|
|
44
|
-
Assert is an assertion
|
42
|
+
Assert is an assertion-style testing framework, meaning you use assertion statements to define your tests and create results. Assert uses class-based contexts so if you want to nest your contexts, use inheritance.
|
45
43
|
|
46
44
|
### Features
|
47
45
|
|
@@ -52,6 +50,7 @@ Assert is an assertion style testing framework, meaning you use assertion statem
|
|
52
50
|
* class-based contexts
|
53
51
|
* multiple before/setup & after/teardown blocks
|
54
52
|
* around blocks
|
53
|
+
* `let` value declarations
|
55
54
|
* full backtrace for errors
|
56
55
|
* optionally pretty print objects in failure descriptions
|
57
56
|
* [stubbing API](https://github.com/redding/assert#stub)
|
@@ -73,64 +72,92 @@ Assert comes with a stubbing API - all it does is replace method calls. In gene
|
|
73
72
|
* no methods are added to `Object` to support stubbing
|
74
73
|
* stubs are auto-unstubbed on test teardown
|
75
74
|
|
76
|
-
**Note**: Assert's stubbing logic has been extracted into a separate gem: [MuchStub](https://github.com/redding/much-stub/#muchstub). However, the main `Assert.{stub|unstub|stub_send|etc}` api is still available (it just proxies MuchStub now).
|
75
|
+
**Note**: Assert's stubbing logic has been extracted into a separate gem: [MuchStub](https://github.com/redding/much-stub/#muchstub). However, the main `Assert.{stub|unstub|stub_send|stub_tap|etc}` api is still available (it just proxies to MuchStub now).
|
77
76
|
|
78
77
|
```ruby
|
79
78
|
myclass = Class.new do
|
80
|
-
def
|
81
|
-
|
79
|
+
def my_method
|
80
|
+
"my_method"
|
81
|
+
end
|
82
|
+
|
83
|
+
def my_value(value)
|
84
|
+
value
|
85
|
+
end
|
82
86
|
end
|
83
|
-
|
87
|
+
my_object = myclass.new
|
84
88
|
|
85
|
-
|
86
|
-
# =>
|
87
|
-
|
89
|
+
my_object.my_method
|
90
|
+
# => "my_method"
|
91
|
+
my_object.my_value(123)
|
88
92
|
# => 123
|
89
|
-
|
93
|
+
my_object.my_value(456)
|
90
94
|
# => 456
|
91
95
|
|
92
|
-
Assert.stub(
|
93
|
-
|
94
|
-
# => StubError: `
|
95
|
-
Assert.stub(
|
96
|
-
|
97
|
-
# =>
|
98
|
-
|
96
|
+
Assert.stub(my_object, :my_method)
|
97
|
+
my_object.my_method
|
98
|
+
# => StubError: `my_method` not stubbed.
|
99
|
+
Assert.stub(my_object, :my_method){ "stub-meth" }
|
100
|
+
my_object.my_method
|
101
|
+
# => "stub-meth"
|
102
|
+
my_object.my_method(123)
|
99
103
|
# => StubError: arity mismatch
|
100
|
-
Assert.stub(
|
104
|
+
Assert.stub(my_object, :my_method).with(123){ "stub-meth" }
|
101
105
|
# => StubError: arity mismatch
|
102
|
-
Assert.stub_send(myobj, :mymeth) # call to the original method post-stub
|
103
|
-
# => 'meth'
|
104
106
|
|
105
|
-
|
107
|
+
# Call the original method after it has been stubbed.
|
108
|
+
Assert.stub_send(my_object, :my_method)
|
109
|
+
# => "my_method"
|
110
|
+
|
111
|
+
Assert.stub(my_object, :my_value){ "stub-meth" }
|
106
112
|
# => StubError: arity mismatch
|
107
|
-
Assert.stub(
|
108
|
-
|
113
|
+
Assert.stub(my_object, :my_value).with(123){ |val| val.to_s }
|
114
|
+
my_object.my_value
|
109
115
|
# => StubError: arity mismatch
|
110
|
-
|
111
|
-
# =>
|
112
|
-
|
113
|
-
# => StubError: `
|
114
|
-
|
116
|
+
my_object.my_value(123)
|
117
|
+
# => "123"
|
118
|
+
my_object.my_value(456)
|
119
|
+
# => StubError: `my_value(456)` not stubbed.
|
120
|
+
|
121
|
+
# Call the original method after it has been stubbed.
|
122
|
+
Assert.stub_send(my_object, :my_value, 123)
|
115
123
|
# => 123
|
116
|
-
Assert.stub_send(
|
124
|
+
Assert.stub_send(my_object, :my_value, 456)
|
117
125
|
# => 456
|
118
126
|
|
119
|
-
|
120
|
-
|
127
|
+
# Stub a method while preserving its behavior and return value.
|
128
|
+
my_value_called_with = nil
|
129
|
+
Assert.stub_tap(my_object, :my_value) { |value, *args|
|
130
|
+
my_value_called_with = args
|
131
|
+
Assert.stub(value, :to_s) { "FIREWORKS!" }
|
132
|
+
}
|
133
|
+
value = my_object.my_value(123)
|
134
|
+
# => 123
|
135
|
+
my_value_called_with
|
136
|
+
# => [123]
|
137
|
+
value.to_s
|
138
|
+
# =>"FIREWORKS!"
|
139
|
+
|
140
|
+
# Unstub individual stubs
|
141
|
+
Assert.unstub(my_object, :my_method)
|
142
|
+
Assert.unstub(my_object, :my_value)
|
121
143
|
|
122
|
-
|
123
|
-
|
124
|
-
|
144
|
+
# OR blanket unstub all stubs
|
145
|
+
Assert.unstub!
|
146
|
+
|
147
|
+
my_object.my_method
|
148
|
+
# => "my_method"
|
149
|
+
my_object.my_value(123)
|
125
150
|
# => 123
|
126
|
-
|
151
|
+
value = my_object.my_value(456)
|
127
152
|
# => 456
|
153
|
+
value.to_s
|
154
|
+
# => "456"
|
128
155
|
```
|
129
156
|
|
130
157
|
## Factory
|
131
158
|
|
132
159
|
```ruby
|
133
|
-
require
|
160
|
+
require "assert/factory"
|
134
161
|
|
135
162
|
Assert::Factory.integer #=> 15742
|
136
163
|
Assert::Factory.integer(3) #=> 2
|
@@ -197,7 +224,7 @@ As an example, say your test folder has a file structure like so:
|
|
197
224
|
| | - slow_tests.rb
|
198
225
|
```
|
199
226
|
|
200
|
-
* `$ assert` - runs all tests (
|
227
|
+
* `$ assert` - runs all tests ("./test" is used if no paths are given)
|
201
228
|
* `$ assert test/basic` - run all tests in basic_tests.rb
|
202
229
|
* `$ assert test/complex/fast_tests.rb` - runs all tests in fast_tests.rb
|
203
230
|
* `$ assert test/basic test/comp` - runs all tests in basic_tests.rb, complex_tests.rb, fast_tests.rb and slow_tests.rb
|
@@ -237,7 +264,7 @@ Assert accepts options from its CLI. Use these options to specify absolute runt
|
|
237
264
|
Assert uses its [`Assert::Runner`](/lib/assert/runner.rb) to run tests. You can extend this default runner or use your own runner implementation. Specify it in your user/local settings:
|
238
265
|
|
239
266
|
```ruby
|
240
|
-
require
|
267
|
+
require "my_awesome_runner_class"
|
241
268
|
|
242
269
|
Assert.configure do |config|
|
243
270
|
config.runner MyAwesomeRunnerClass.new
|
@@ -326,7 +353,7 @@ $ assert [-v|--verbose|--no-verbose]
|
|
326
353
|
|
327
354
|
### Capture Output
|
328
355
|
|
329
|
-
By default, Assert shows any output on `$stdout` produced while running a test. It provides a setting to override whether to show this output or to
|
356
|
+
By default, Assert shows any output on `$stdout` produced while running a test. It provides a setting to override whether to show this output or to "capture" it and display it in the test result details:
|
330
357
|
|
331
358
|
In user/local settings file:
|
332
359
|
|
@@ -404,7 +431,7 @@ This, of course, assumes you are working in a git repository. If you are not or
|
|
404
431
|
```ruby
|
405
432
|
Assert.configure do |config|
|
406
433
|
config.changed_proc Proc.new do |config, test_paths|
|
407
|
-
`git diff --name-only master -- #{test_paths.join(
|
434
|
+
`git diff --name-only master -- #{test_paths.join(" ")}`.split("\n") # or whatever
|
408
435
|
end
|
409
436
|
end
|
410
437
|
```
|
@@ -413,13 +440,11 @@ If you just want to disable this feature completely:
|
|
413
440
|
|
414
441
|
```ruby
|
415
442
|
Assert.configure do |config|
|
416
|
-
|
417
443
|
# run nothing if the `-c` flag is given
|
418
444
|
config.changed_proc Proc.new{ |config, test_paths| [] }
|
419
445
|
|
420
446
|
# run all test paths if the `-c` flag is given
|
421
447
|
config.changed_proc Proc.new{ |config, test_paths| test_paths }
|
422
|
-
|
423
448
|
end
|
424
449
|
```
|
425
450
|
|
@@ -571,7 +596,7 @@ Beyond that, each view can do as it sees fit. Initialize how you wish, take wha
|
|
571
596
|
To use a 3rd party custom view, first require it in and then configure it. Assert provides a helper for requiring in views. It can be used in two ways. You can pass a fully qualified path to the helper and if it exists, will require it in.
|
572
597
|
|
573
598
|
```ruby
|
574
|
-
Assert::View.require_user_view
|
599
|
+
Assert::View.require_user_view "/path/to/my/view"
|
575
600
|
```
|
576
601
|
|
577
602
|
Alternatively, you can install/clone/copy/write your view implementations in `~/.assert/views` and require it in by name. To have assert require it by name, have it installed at `~/assert/views/view_name/lib/view_name.rb` (this structure is compatible with popular conventions for rubygem development). For example:
|
@@ -579,7 +604,7 @@ Alternatively, you can install/clone/copy/write your view implementations in `~/
|
|
579
604
|
```ruby
|
580
605
|
# assuming ~/.assert/views/my-custom-view/lib/my-custom-view.rb exists
|
581
606
|
# this will require it in
|
582
|
-
Assert::View.require_user_view
|
607
|
+
Assert::View.require_user_view "my-custom-view"
|
583
608
|
```
|
584
609
|
|
585
610
|
Once your view class is required in, use it and configure it just as you would any view.
|
@@ -592,7 +617,7 @@ A `Suite` object is reponsible for collecting and structuring tests and defines
|
|
592
617
|
|
593
618
|
### Runner
|
594
619
|
|
595
|
-
A `Runner` object is responsible for running a suite of tests and firing event callbacks to the `View`. Any runner object should take the test suite and view as arguments and should provide a
|
620
|
+
A `Runner` object is responsible for running a suite of tests and firing event callbacks to the `View`. Any runner object should take the test suite and view as arguments and should provide a "run" method that runs the tests and renders the view.
|
596
621
|
|
597
622
|
### Context
|
598
623
|
|
@@ -620,7 +645,7 @@ A `View` object is responsible for rendering test result output. Assert provide
|
|
620
645
|
|
621
646
|
### Macro
|
622
647
|
|
623
|
-
Macros are procs that define sets of test code and make it available for easy reuse. Macros work nicely with the
|
648
|
+
Macros are procs that define sets of test code and make it available for easy reuse. Macros work nicely with the "should" and "test" context methods.
|
624
649
|
|
625
650
|
## Installation
|
626
651
|
|
@@ -636,10 +661,10 @@ If submitting a Pull Request, please:
|
|
636
661
|
|
637
662
|
1. Fork it
|
638
663
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
639
|
-
3. Commit your changes (`git commit -am
|
664
|
+
3. Commit your changes (`git commit -am "Added some feature"`)
|
640
665
|
4. Push to the branch (`git push origin my-new-feature`)
|
641
666
|
5. Create new Pull Request
|
642
667
|
|
643
668
|
One note: please respect that Assert itself is intended to be the flexible, base-level, framework-type logic that should change little if at all. Pull requests for niche functionality or personal testing philosphy stuff will likely not be accepted.
|
644
669
|
|
645
|
-
If you wish to extend Assert for your niche purpose/desire/philosophy, please do so in
|
670
|
+
If you wish to extend Assert for your niche purpose/desire/philosophy, please do so in its own gem (preferrably named `assert-<whatever>`) that uses Assert as a dependency.
|
data/assert.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require "assert/version"
|
5
5
|
|
@@ -11,14 +11,15 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.summary = %q{Assertion style testing framework.}
|
12
12
|
gem.description = %q{Assertion style testing framework.}
|
13
13
|
gem.homepage = "http://github.com/redding/assert"
|
14
|
-
gem.license =
|
14
|
+
gem.license = "MIT"
|
15
15
|
|
16
|
-
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.files = `git ls-files | grep "^[^.]"`.split($/)
|
17
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.
|
22
|
-
gem.add_dependency("much-stub", ["~> 0.1.0"])
|
21
|
+
gem.required_ruby_version = "~> 2.5"
|
23
22
|
|
23
|
+
gem.add_dependency("much-factory", ["~> 0.1.0"])
|
24
|
+
gem.add_dependency("much-stub", ["~> 0.1.4"])
|
24
25
|
end
|
data/bin/assert
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Copyright (c) 2011-Present Kelly Redding and Collin Redding
|
4
4
|
#
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
6
|
+
require "assert"
|
7
|
+
require "assert/cli"
|
8
8
|
|
9
|
-
Assert.config.debug ENV[
|
9
|
+
Assert.config.debug ENV["ASSERT_DEBUG"] == "true" || Assert::CLI.debug?(ARGV)
|
10
10
|
|
11
|
-
Assert::CLI.bench(
|
11
|
+
Assert::CLI.bench("CLI init and parse"){ @cli = Assert::CLI.new(*ARGV) }
|
12
12
|
@cli.run
|
data/lib/assert.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require "assert/version"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
3
|
+
require "assert/config"
|
4
|
+
require "assert/context"
|
5
|
+
require "assert/runner"
|
6
|
+
require "assert/stub"
|
7
|
+
require "assert/suite"
|
8
|
+
require "assert/utils"
|
9
|
+
require "assert/view"
|
10
10
|
|
11
11
|
module Assert
|
12
|
-
|
13
12
|
def self.config; @config ||= Config.new; end
|
14
13
|
def self.configure; yield self.config if block_given?; end
|
15
14
|
|
@@ -21,14 +20,5 @@ module Assert
|
|
21
20
|
class Context
|
22
21
|
teardown{ Assert.unstub! }
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
26
24
|
|
27
|
-
# Kernel#caller_locations polyfill for pre ruby 2.0.0
|
28
|
-
if RUBY_VERSION =~ /\A1\..+/ && !Kernel.respond_to?(:caller_locations)
|
29
|
-
module Kernel
|
30
|
-
def caller_locations(start = 1, length = nil)
|
31
|
-
length ? caller[start, length] : caller[start..-1]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
require "much-stub"
|
2
|
+
|
3
|
+
module Assert; end
|
4
|
+
class Assert::ActualValue
|
5
|
+
def initialize(value, context:)
|
6
|
+
@value = value
|
7
|
+
@context = context
|
8
|
+
end
|
9
|
+
|
10
|
+
def returns_true(*args)
|
11
|
+
@context.assert_block(*args, &@value)
|
12
|
+
end
|
13
|
+
|
14
|
+
def does_not_return_true(*args)
|
15
|
+
@context.assert_not_block(*args, &@value)
|
16
|
+
end
|
17
|
+
|
18
|
+
def raises(*expected_exceptions)
|
19
|
+
@context.assert_raises(*expected_exceptions, &@value)
|
20
|
+
end
|
21
|
+
|
22
|
+
def does_not_raise(*expected_exceptions)
|
23
|
+
@context.assert_nothing_raised(*expected_exceptions, &@value)
|
24
|
+
end
|
25
|
+
|
26
|
+
def is_a_kind_of(expected_class, *args)
|
27
|
+
@context.assert_kind_of(expected_class, @value, *args)
|
28
|
+
end
|
29
|
+
alias_method :is_kind_of, :is_a_kind_of
|
30
|
+
|
31
|
+
def is_not_a_kind_of(expected_class, *args)
|
32
|
+
@context.assert_not_kind_of(expected_class, @value, *args)
|
33
|
+
end
|
34
|
+
alias_method :is_not_kind_of, :is_not_a_kind_of
|
35
|
+
|
36
|
+
def is_an_instance_of(expected_class, *args)
|
37
|
+
@context.assert_instance_of(expected_class, @value, *args)
|
38
|
+
end
|
39
|
+
alias_method :is_instance_of, :is_an_instance_of
|
40
|
+
|
41
|
+
def is_not_an_instance_of(expected_class, *args)
|
42
|
+
@context.assert_not_instance_of(expected_class, @value, *args)
|
43
|
+
end
|
44
|
+
alias_method :is_not_instance_of, :is_not_an_instance_of
|
45
|
+
|
46
|
+
def responds_to(expected_method_name, *args)
|
47
|
+
@context.assert_responds_to(expected_method_name, @value, *args)
|
48
|
+
end
|
49
|
+
|
50
|
+
def does_not_respond_to(expected_method_name, *args)
|
51
|
+
@context.assert_not_responds_to(expected_method_name, @value, *args)
|
52
|
+
end
|
53
|
+
|
54
|
+
def is_the_same_as(expected_object, *args)
|
55
|
+
@context.assert_same(expected_object, @value, *args)
|
56
|
+
end
|
57
|
+
|
58
|
+
def is_not_the_same_as(expected_object, *args)
|
59
|
+
@context.assert_not_same(expected_object, @value, *args)
|
60
|
+
end
|
61
|
+
|
62
|
+
def equals(expected_value, *args)
|
63
|
+
@context.assert_equal(expected_value, @value, *args)
|
64
|
+
end
|
65
|
+
alias_method :is_equal_to, :equals
|
66
|
+
|
67
|
+
def does_not_equal(expected_value, *args)
|
68
|
+
@context.assert_not_equal(expected_value, @value, *args)
|
69
|
+
end
|
70
|
+
alias_method :is_not_equal_to, :does_not_equal
|
71
|
+
|
72
|
+
def matches(expected_regex, *args)
|
73
|
+
@context.assert_match(expected_regex, @value, *args)
|
74
|
+
end
|
75
|
+
|
76
|
+
def does_not_match(expected_regex, *args)
|
77
|
+
@context.assert_not_match(expected_regex, @value, *args)
|
78
|
+
end
|
79
|
+
|
80
|
+
def is_empty(*args)
|
81
|
+
@context.assert_empty(@value, *args)
|
82
|
+
end
|
83
|
+
|
84
|
+
def is_not_empty(*args)
|
85
|
+
@context.assert_not_empty(@value, *args)
|
86
|
+
end
|
87
|
+
|
88
|
+
def includes(object, *args)
|
89
|
+
@context.assert_includes(object, @value, *args)
|
90
|
+
end
|
91
|
+
|
92
|
+
def does_not_include(object, *args)
|
93
|
+
@context.assert_not_includes(object, @value, *args)
|
94
|
+
end
|
95
|
+
|
96
|
+
def is_nil(*args)
|
97
|
+
@context.assert_nil(@value, *args)
|
98
|
+
end
|
99
|
+
|
100
|
+
def is_not_nil(*args)
|
101
|
+
@context.assert_not_nil(@value, *args)
|
102
|
+
end
|
103
|
+
|
104
|
+
def is_true(*args)
|
105
|
+
@context.assert_true(@value, *args)
|
106
|
+
end
|
107
|
+
|
108
|
+
def is_not_true(*args)
|
109
|
+
@context.assert_not_true(@value, *args)
|
110
|
+
end
|
111
|
+
|
112
|
+
def is_false(*args)
|
113
|
+
@context.assert_false(@value, *args)
|
114
|
+
end
|
115
|
+
|
116
|
+
def is_not_false(*args)
|
117
|
+
@context.assert_not_false(@value, *args)
|
118
|
+
end
|
119
|
+
|
120
|
+
def is_a_file(*args)
|
121
|
+
@context.assert_file_exists(@value, *args)
|
122
|
+
end
|
123
|
+
|
124
|
+
def is_not_a_file(*args)
|
125
|
+
@context.assert_not_file_exists(@value, *args)
|
126
|
+
end
|
127
|
+
end
|