metasploit-model 1.0.0.pre.rails.pre.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -4
- data/CHANGELOG.md +6 -0
- data/CONTRIBUTING.md +9 -49
- data/Gemfile +1 -6
- data/RELEASING.md +89 -0
- data/UPGRADING.md +1 -0
- data/lib/metasploit/model/version.rb +23 -11
- data/metasploit-model.gemspec +3 -1
- data/spec/app/models/metasploit/model/association/reflection_spec.rb +5 -7
- data/spec/app/models/metasploit/model/search/group/base_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/group/intersection_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/group/union_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operation/association_spec.rb +7 -9
- data/spec/app/models/metasploit/model/search/operation/base_spec.rb +5 -7
- data/spec/app/models/metasploit/model/search/operation/boolean_spec.rb +14 -11
- data/spec/app/models/metasploit/model/search/operation/date_spec.rb +6 -8
- data/spec/app/models/metasploit/model/search/operation/group/base_spec.rb +12 -14
- data/spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operation/group/union_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operation/integer_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operation/null_spec.rb +4 -6
- data/spec/app/models/metasploit/model/search/operation/set/integer_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operation/set/string_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operation/set_spec.rb +4 -6
- data/spec/app/models/metasploit/model/search/operation/string_spec.rb +2 -4
- data/spec/app/models/metasploit/model/search/operator/association_spec.rb +6 -8
- data/spec/app/models/metasploit/model/search/operator/attribute_spec.rb +13 -15
- data/spec/app/models/metasploit/model/search/operator/base_spec.rb +3 -5
- data/spec/app/models/metasploit/model/search/operator/delegation_spec.rb +13 -11
- data/spec/app/models/metasploit/model/search/operator/group/base_spec.rb +5 -7
- data/spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb +3 -5
- data/spec/app/models/metasploit/model/search/operator/group/union_spec.rb +3 -5
- data/spec/app/models/metasploit/model/search/operator/null_spec.rb +5 -7
- data/spec/app/models/metasploit/model/search/operator/single_spec.rb +26 -28
- data/spec/app/models/metasploit/model/search/query_spec.rb +48 -50
- data/spec/app/models/metasploit/model/visitation/visitor_spec.rb +7 -9
- data/spec/app/validators/ip_format_validator_spec.rb +7 -9
- data/spec/app/validators/nil_validator_spec.rb +3 -5
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +17 -19
- data/spec/lib/metasploit/model/association/error_spec.rb +1 -3
- data/spec/lib/metasploit/model/association_spec.rb +8 -10
- data/spec/lib/metasploit/model/base_spec.rb +3 -5
- data/spec/lib/metasploit/model/engine_spec.rb +48 -11
- data/spec/lib/metasploit/model/file_spec.rb +3 -5
- data/spec/lib/metasploit/model/invalid_spec.rb +7 -9
- data/spec/lib/metasploit/model/login/status_spec.rb +1 -3
- data/spec/lib/metasploit/model/nilify_blanks_spec.rb +11 -13
- data/spec/lib/metasploit/model/realm/key_spec.rb +15 -17
- data/spec/lib/metasploit/model/search/association/tree_spec.rb +3 -5
- data/spec/lib/metasploit/model/search/association_spec.rb +2 -4
- data/spec/lib/metasploit/model/search/attribute_spec.rb +6 -8
- data/spec/lib/metasploit/model/search/operation/value/integer_spec.rb +1 -3
- data/spec/lib/metasploit/model/search/operation/value/string_spec.rb +1 -3
- data/spec/lib/metasploit/model/search/operation_spec.rb +11 -13
- data/spec/lib/metasploit/model/search/operator/help_spec.rb +1 -3
- data/spec/lib/metasploit/model/search/with_spec.rb +7 -9
- data/spec/lib/metasploit/model/search_spec.rb +11 -13
- data/spec/lib/metasploit/model/spec/error_spec.rb +2 -4
- data/spec/lib/metasploit/model/spec/i18n_exception_handler_spec.rb +5 -7
- data/spec/lib/metasploit/model/spec/pathname_collision_spec.rb +4 -6
- data/spec/lib/metasploit/model/spec_spec.rb +9 -7
- data/spec/lib/metasploit/model/translation_spec.rb +10 -12
- data/spec/lib/metasploit/model/version_spec.rb +3 -139
- data/spec/lib/metasploit/model/visitation/visit_spec.rb +28 -26
- data/spec/lib/metasploit/model_spec.rb +4 -0
- data/spec/matchers/validate_nilness_of_spec.rb +0 -2
- data/spec/spec_helper.rb +80 -10
- data/spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb +1 -1
- data/spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb +8 -8
- data/spec/support/shared/examples/metasploit/model/search/operation/value/string.rb +5 -5
- data/spec/support/shared/examples/metasploit/model/search/operator/help.rb +18 -16
- data/spec/support/shared/examples/metasploit/model/translation.rb +4 -4
- data/spec/support/shared/examples/search/query.rb +3 -3
- data/spec/support/shared/examples/search_association.rb +2 -2
- data/spec/support/shared/examples/search_attribute.rb +3 -3
- data/spec/support/shared/examples/search_with.rb +3 -3
- metadata +43 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1968cb01611576829be9cee99731ec519c7d744
|
4
|
+
data.tar.gz: af71934474a21158825dde88a043cbd0beca3367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc52b352a519f19121f6bd64a7703c0e2cbe9c92bf67cac3c9f1ef1bf3dd6d1f4e1a72aac3079760557b7f17e565c2d90ea0ad2a7c3ef71e9215fa090bbe93a5
|
7
|
+
data.tar.gz: 6806e8a9307caf65bacda42f348ebb83d55bf3dca0e645ecbeb6bfd9579bcbf368f8f4bda743674d91021a242b22b729ff800729b41dc67ad52362713e2078f5
|
data/.rspec
CHANGED
data/CHANGELOG.md
ADDED
data/CONTRIBUTING.md
CHANGED
@@ -25,19 +25,18 @@ issue tracking software.
|
|
25
25
|
|
26
26
|
### `PRERELEASE`
|
27
27
|
|
28
|
-
1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/model/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
|
28
|
+
1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/model/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
|
29
29
|
```
|
30
|
-
# The prerelease version, scoped to the {PATCH} version number.
|
30
|
+
# The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version number.
|
31
31
|
PRERELEASE = '<SUMMARY>'
|
32
32
|
```
|
33
33
|
2. `rake spec`
|
34
34
|
3. Verify the specs pass, which indicates that `PRERELEASE` was updated correctly.
|
35
35
|
4. Commit the change `git commit -a`
|
36
36
|
|
37
|
-
|
38
37
|
### Your changes
|
39
38
|
|
40
|
-
Make your changes or however many commits you like,
|
39
|
+
Make your changes or however many commits you like, committing each with `git commit`.
|
41
40
|
|
42
41
|
### Pre-Pull Request Testing
|
43
42
|
|
@@ -46,12 +45,12 @@ Make your changes or however many commits you like, commiting each with `git com
|
|
46
45
|
|
47
46
|
### Push
|
48
47
|
|
49
|
-
Push your branch to your fork on
|
48
|
+
Push your branch to your fork on github: `git push TYPE/ISSUE/SUMMARY`
|
50
49
|
|
51
50
|
### Pull Request
|
52
51
|
|
53
52
|
* [Create new Pull Request](https://github.com/rapid7/metasploit-model/compare/)
|
54
|
-
* Add a Verification Steps comment
|
53
|
+
* Add a Verification Steps to the description comment
|
55
54
|
|
56
55
|
```
|
57
56
|
# Verification Steps
|
@@ -62,6 +61,7 @@ Push your branch to your fork on gitub: `git push push TYPE/ISSUE/SUMMARY`
|
|
62
61
|
- [ ] `rake spec`
|
63
62
|
- [ ] VERIFY no failures
|
64
63
|
```
|
64
|
+
|
65
65
|
You should also include at least one scenario to manually check the changes outside of specs.
|
66
66
|
|
67
67
|
* Add a Post-merge Steps comment
|
@@ -106,7 +106,7 @@ Perform these steps prior to pushing to DESTINATION or the build will be broke o
|
|
106
106
|
- [ ] Change `PRERELEASE` from `SOURCE_SUMMARY` to `DESTINATION_SUMMARY` to match the branch (DESTINATION) summary (DESTINATION_SUMMARY)
|
107
107
|
|
108
108
|
## Gem build
|
109
|
-
- [ ] gem build
|
109
|
+
- [ ] gem build metasploit-model.gemspec
|
110
110
|
- [ ] VERIFY the prerelease suffix has change on the gem.
|
111
111
|
|
112
112
|
## RSpec
|
@@ -118,45 +118,5 @@ Perform these steps prior to pushing to DESTINATION or the build will be broke o
|
|
118
118
|
- [ ] `git push origin DESTINATION`
|
119
119
|
```
|
120
120
|
|
121
|
-
|
122
|
-
|
123
|
-
The 'Release Steps' are a reminder to the reviewer of the Pull Request of how to release the gem.
|
124
|
-
|
125
|
-
```
|
126
|
-
# Release
|
127
|
-
|
128
|
-
Complete these steps on DESTINATION
|
129
|
-
|
130
|
-
## Version
|
131
|
-
|
132
|
-
### Compatible changes
|
133
|
-
|
134
|
-
If the change are compatible with the previous branch's API, then increment [`PATCH`](lib/metasploit/model/version.rb).
|
135
|
-
|
136
|
-
### Incompatible changes
|
137
|
-
|
138
|
-
If your changes are incompatible with the previous branch's API, then increment
|
139
|
-
[`MINOR`](lib/metasploit/model/version.rb) and reset [`PATCH`](lib/metasploit/model/version.rb) to `0`.
|
140
|
-
|
141
|
-
- [ ] Following the rules for [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html), update
|
142
|
-
[`MINOR`](lib/metasploit/model/version.rb) and [`PATCH`](lib/metasploit/model/version.rb) and commit the changes.
|
143
|
-
|
144
|
-
## JRuby
|
145
|
-
- [ ] `rvm use jruby@metasploit-model`
|
146
|
-
- [ ] `rm Gemfile.lock`
|
147
|
-
- [ ] `bundle install`
|
148
|
-
- [ ] `rake release`
|
149
|
-
|
150
|
-
## MRI Ruby
|
151
|
-
- [ ] `rvm use ruby-2.1@metasploit-model`
|
152
|
-
- [ ] `rm Gemfile.lock`
|
153
|
-
- [ ] `bundle install`
|
154
|
-
- [ ] `rake release`
|
155
|
-
```
|
156
|
-
|
157
|
-
### Downstream dependencies
|
158
|
-
|
159
|
-
When releasing new versions, the following projects may need to be updated:
|
160
|
-
|
161
|
-
* [metasploit_data_models](https://github.com/rapid7/metasploit_data_models)
|
162
|
-
* [metasploit-credential](https://github.com/rapid7/metasploit-credential)
|
121
|
+
To update the [CHANGELOG.md](CHANGELOG.md) with the merged changes or release the merged code see
|
122
|
+
[RELEASING.md](RELEASING.md)
|
data/Gemfile
CHANGED
@@ -26,12 +26,7 @@ group :test do
|
|
26
26
|
gem 'coveralls', require: false
|
27
27
|
# Engine tasks are loaded using railtie
|
28
28
|
gem 'railties', *rails_version_constraint
|
29
|
-
gem 'rspec'
|
30
|
-
# need rspec-core >= 2.14.0 because 2.14.0 introduced RSpec::Core::SharedExampleGroup::TopLevel
|
31
|
-
gem 'rspec-core', '>= 2.14.0', '< 3.0.0'
|
32
|
-
# need rspec-rails >= 2.12.0 as 2.12.0 adds support for redefining named subject in nested context that uses the
|
33
|
-
# named subject from the outer context without causing a stack overflow.
|
34
|
-
gem 'rspec-rails', '>= 2.12.0'
|
29
|
+
gem 'rspec-rails', '~> 3.1'
|
35
30
|
# In a full rails project, factory_girl_rails would be in both the :development, and :test group, but since we only
|
36
31
|
# want rails in :test, factory_girl_rails must also only be in :test.
|
37
32
|
# add matchers from shoulda, such as validates_presence_of, which are useful for testing validations
|
data/RELEASING.md
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# Releasing
|
2
|
+
|
3
|
+
These steps can be added to the Pull Request description's task list to remind the reviewer of how to release the
|
4
|
+
gem.
|
5
|
+
|
6
|
+
```
|
7
|
+
# Release
|
8
|
+
|
9
|
+
Complete these steps on DESTINATION
|
10
|
+
|
11
|
+
## [CHANGELOG.md](CHANGELOG.md)
|
12
|
+
|
13
|
+
### Terminology
|
14
|
+
|
15
|
+
* "Enhancements" are widening the API, such as by adding new classes or methods.
|
16
|
+
* "Bug Fixes" are fixes to the implementation that do not affect the public API. If the public API is affected then
|
17
|
+
the change should be listed as both a "Bug Fix" and either an "Enhancement" or "Incompatible Change" depending on how
|
18
|
+
the bug was fixed.
|
19
|
+
* "Deprecations" are changes to the implementation that cause deprecation warnings to be issued for APIs which will be
|
20
|
+
removed in a future major release. "Deprecations" are usually accompanied by an Enhancement that creates a new API
|
21
|
+
that is meant to be used in favor of the deprecated API.
|
22
|
+
* "Incompatible Changes" are the removal of classes or methods or new required arguments or setup that shrink the API.
|
23
|
+
It is best practice to make a "Deprecation" for the API prior to its removal.
|
24
|
+
|
25
|
+
### Task List
|
26
|
+
|
27
|
+
- [ ] Generate the list of changes since the last release: `git log v<LAST_MAJOR>.<LAST_MINOR>.<LAST_PATCH>..HEAD`
|
28
|
+
- [ ] For each commit in the release, find the corresponding PR by search for the commit on Github.
|
29
|
+
- [ ] For each PR, determine whether it is an Enhancement, Bug Fix, Deprecation, and/or Incompatible Change. A PR can
|
30
|
+
be in more than one category, in which case it should be listed in each category it belongs, but with a category
|
31
|
+
specific description of the change.
|
32
|
+
- [ ] Add an item to each category's list in the following format: `[#<PR>](https://github.com/rapid7/metasploit-model/pull/<PR>) <consumer summary> - [@<github_user>](https://github.com/<github_user>)`
|
33
|
+
`consumer_summary` should be a summary of the Enhancement, Bug Fix, Deprecation, or Incompatible Change from a
|
34
|
+
downstream consumer's of the library's perspective. `github_user` should be Github handle of the author of the
|
35
|
+
PR.
|
36
|
+
- [ ] If you added any Deprecations or Incompatible Changes, then adding upgrading information to
|
37
|
+
[UPGRADING.md](UPGRADING.md)
|
38
|
+
|
39
|
+
## `VERSION`
|
40
|
+
|
41
|
+
The entries in the [CHANGELOG.md](CHANGELOG.md) can be used to help determine how the `VERSION` should be bumped.
|
42
|
+
|
43
|
+
### Bug fixes
|
44
|
+
|
45
|
+
If the [CHANGELOG.md](CHANGELOG.md) contains only Bug Fixes for the Next Release, then increment
|
46
|
+
[`PATCH`](lib/metasploit/model/version.rb).
|
47
|
+
|
48
|
+
### Compatible API changes
|
49
|
+
|
50
|
+
If the [CHANGELOG.md](CHANGELOG.md) contains any Enhancements or Deprecations, then increment
|
51
|
+
[`MINOR`](lib/metasploit/model/version.rb) and reset [`PATCH`](lib/metasploit/model/version.rb) to `0`.
|
52
|
+
|
53
|
+
### Incompatible API changes
|
54
|
+
|
55
|
+
If the [CHANGELOG.md](CHANGELOG.md) contains any Incompatible Change, then increment
|
56
|
+
[`MAJOR`](lib/metasploit/model/version.rb) and reset [`MINOR`](lib/metasploit/model/version.rb and
|
57
|
+
[`PATCH`](lib/metasploit/model/version.rb) to `0`.
|
58
|
+
|
59
|
+
## Setup [CHANGELOG.md](CHANGELOG.md) for next release
|
60
|
+
|
61
|
+
- [ ] Change `Next Release` section name at the top of [CHANGELOG.md](CHANGELOG.md) to match the current `VERSION`.
|
62
|
+
- [ ] Add a new `Next Release` section above the `VERSION`'s section you just renamed:
|
63
|
+
<pre>
|
64
|
+
# Next Release
|
65
|
+
|
66
|
+
* Enhancements
|
67
|
+
* Bug Fixes
|
68
|
+
* Deprecations
|
69
|
+
* Incompatible Changes
|
70
|
+
</pre>
|
71
|
+
|
72
|
+
## Release to rubygems.org
|
73
|
+
|
74
|
+
## jruby
|
75
|
+
- [ ] `rvm use jruby@metasploit-model`
|
76
|
+
- [ ] `rm Gemfile.lock`
|
77
|
+
- [ ] `bundle install`
|
78
|
+
- [ ] `rake release`
|
79
|
+
|
80
|
+
## ruby-2.1
|
81
|
+
- [ ] `rvm use ruby-2.1@metasploit-model`
|
82
|
+
- [ ] `rm Gemfile.lock`
|
83
|
+
- [ ] `bundle install`
|
84
|
+
- [ ] `rake release`
|
85
|
+
```
|
86
|
+
|
87
|
+
### Downstream dependencies
|
88
|
+
|
89
|
+
There are currently no known downstream dependencies
|
data/UPGRADING.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
No Deprecations or Incompatible Changes have been introduced at this time
|
@@ -2,20 +2,29 @@ module Metasploit
|
|
2
2
|
module Model
|
3
3
|
# Holds components of {VERSION} as defined by {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0}.
|
4
4
|
module Version
|
5
|
+
#
|
6
|
+
# CONSTANTS
|
7
|
+
#
|
8
|
+
|
5
9
|
# The major version number.
|
6
10
|
MAJOR = 1
|
7
11
|
# The minor version number, scoped to the {MAJOR} version number.
|
8
12
|
MINOR = 0
|
9
|
-
# The patch number, scoped to the {MINOR} version
|
13
|
+
# The patch version number, scoped to the {MAJOR} and {MINOR} version numbers.
|
10
14
|
PATCH = 0
|
11
|
-
# the prerelease identifier
|
12
|
-
PRERELEASE = 'rails-4.0'
|
13
15
|
|
14
|
-
#
|
16
|
+
#
|
17
|
+
# Module Methods
|
18
|
+
#
|
19
|
+
|
20
|
+
# The full version string, including the {Metasploit::Model::Version::MAJOR},
|
21
|
+
# {Metasploit::Model::Version::MINOR}, {Metasploit::Model::Version::PATCH}, and optionally, the
|
22
|
+
# `Metasploit::Model::Version::PRERELEASE` in the
|
15
23
|
# {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
|
16
24
|
#
|
17
|
-
# @return [String] '{MAJOR}.{MINOR}.{PATCH}'
|
18
|
-
#
|
25
|
+
# @return [String] '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}'
|
26
|
+
# on master. '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}-PRERELEASE'
|
27
|
+
# on any branch other than master.
|
19
28
|
def self.full
|
20
29
|
version = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
21
30
|
|
@@ -26,20 +35,23 @@ module Metasploit
|
|
26
35
|
version
|
27
36
|
end
|
28
37
|
|
29
|
-
# The full gem version string, including the {MAJOR},
|
38
|
+
# The full gem version string, including the {Metasploit::Model::Version::MAJOR},
|
39
|
+
# {Metasploit::Model::Version::MINOR}, {Metasploit::Model::Version::PATCH}, and optionally, the
|
40
|
+
# `Metasploit::Model::Version::PRERELEASE` in the
|
30
41
|
# {http://guides.rubygems.org/specification-reference/#version RubyGems versioning} format.
|
31
42
|
#
|
32
|
-
# @return [String] '{MAJOR}.{MINOR}.{PATCH}'
|
33
|
-
#
|
43
|
+
# @return [String] '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}'
|
44
|
+
# on master. '{Metasploit::Model::Version::MAJOR}.{Metasploit::Model::Version::MINOR}.{Metasploit::Model::Version::PATCH}.PRERELEASE'
|
45
|
+
# on any branch other than master.
|
34
46
|
def self.gem
|
35
47
|
full.gsub('-', '.pre.')
|
36
48
|
end
|
37
49
|
end
|
38
50
|
|
39
|
-
#
|
51
|
+
# (see Version.gem)
|
40
52
|
GEM_VERSION = Version.gem
|
41
53
|
|
42
|
-
#
|
54
|
+
# (see Version.full)
|
43
55
|
VERSION = Version.full
|
44
56
|
end
|
45
57
|
end
|
data/metasploit-model.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.required_ruby_version = '>= 2.1'
|
20
20
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'metasploit-version', '~> 0.1.3'
|
22
23
|
spec.add_development_dependency 'metasploit-yard', '~> 1.0'
|
23
24
|
spec.add_development_dependency 'rake'
|
24
25
|
|
@@ -28,7 +29,8 @@ Gem::Specification.new do |spec|
|
|
28
29
|
|
29
30
|
# Dependency loading
|
30
31
|
rails_version_constraints = ['>= 4.0.9', '< 4.1.0']
|
31
|
-
|
32
|
+
|
33
|
+
spec.add_runtime_dependency 'activemodel', *rails_version_constraints
|
32
34
|
spec.add_runtime_dependency 'activesupport', *rails_version_constraints
|
33
35
|
|
34
36
|
spec.add_runtime_dependency 'railties', *rails_version_constraints
|
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Metasploit::Model::Association::Reflection do
|
1
|
+
RSpec.describe Metasploit::Model::Association::Reflection, type: :model do
|
4
2
|
context 'validations' do
|
5
|
-
it {
|
6
|
-
it {
|
7
|
-
it {
|
3
|
+
it { is_expected.to validate_presence_of :model }
|
4
|
+
it { is_expected.to validate_presence_of :name }
|
5
|
+
it { is_expected.to validate_presence_of :class_name }
|
8
6
|
end
|
9
7
|
|
10
8
|
context '#klass' do
|
@@ -42,7 +40,7 @@ describe Metasploit::Model::Association::Reflection do
|
|
42
40
|
end
|
43
41
|
|
44
42
|
it 'should return Class with Class#name #class_name' do
|
45
|
-
klass.
|
43
|
+
expect(klass).to eq(class_name_class)
|
46
44
|
end
|
47
45
|
end
|
48
46
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Metasploit::Model::Search::Group::Base do
|
4
|
-
it { should ensure_length_of(:children).is_at_least(1) }
|
1
|
+
RSpec.describe Metasploit::Model::Search::Group::Base, type: :model do
|
2
|
+
it { is_expected.to ensure_length_of(:children).is_at_least(1) }
|
5
3
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Metasploit::Model::Search::Group::Intersection do
|
4
|
-
it { should be_a Metasploit::Model::Search::Group::Base }
|
1
|
+
RSpec.describe Metasploit::Model::Search::Group::Intersection, type: :model do
|
2
|
+
it { is_expected.to be_a Metasploit::Model::Search::Group::Base }
|
5
3
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Metasploit::Model::Search::Group::Union do
|
4
|
-
it { should be_a Metasploit::Model::Search::Group::Base }
|
1
|
+
RSpec.describe Metasploit::Model::Search::Group::Union, type: :model do
|
2
|
+
it { is_expected.to be_a Metasploit::Model::Search::Group::Base }
|
5
3
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Metasploit::Model::Search::Operation::Association do
|
1
|
+
RSpec.describe Metasploit::Model::Search::Operation::Association, type: :model do
|
4
2
|
subject(:operation) {
|
5
3
|
described_class.new(
|
6
4
|
source_operation: source_operation
|
@@ -35,7 +33,7 @@ describe Metasploit::Model::Search::Operation::Association do
|
|
35
33
|
true
|
36
34
|
}
|
37
35
|
|
38
|
-
it {
|
36
|
+
it { is_expected.not_to include(invalid_error) }
|
39
37
|
end
|
40
38
|
|
41
39
|
context 'without valid' do
|
@@ -43,7 +41,7 @@ describe Metasploit::Model::Search::Operation::Association do
|
|
43
41
|
false
|
44
42
|
}
|
45
43
|
|
46
|
-
it {
|
44
|
+
it { is_expected.to include(invalid_error) }
|
47
45
|
end
|
48
46
|
end
|
49
47
|
|
@@ -56,12 +54,12 @@ describe Metasploit::Model::Search::Operation::Association do
|
|
56
54
|
nil
|
57
55
|
}
|
58
56
|
|
59
|
-
it {
|
60
|
-
it {
|
57
|
+
it { is_expected.to include(blank_error) }
|
58
|
+
it { is_expected.not_to include(invalid_error) }
|
61
59
|
end
|
62
60
|
end
|
63
61
|
end
|
64
62
|
|
65
|
-
it {
|
66
|
-
it {
|
63
|
+
it { is_expected.not_to respond_to :value }
|
64
|
+
it { is_expected.not_to respond_to :value= }
|
67
65
|
end
|
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Metasploit::Model::Search::Operation::Base do
|
1
|
+
RSpec.describe Metasploit::Model::Search::Operation::Base, type: :model do
|
4
2
|
subject(:operation) do
|
5
3
|
described_class.new
|
6
4
|
end
|
7
5
|
|
8
6
|
context 'validations' do
|
9
7
|
context 'operator' do
|
10
|
-
it {
|
8
|
+
it { is_expected.to validate_presence_of(:operator) }
|
11
9
|
|
12
10
|
context 'valid' do
|
13
11
|
let(:errors) do
|
@@ -40,7 +38,7 @@ describe Metasploit::Model::Search::Operation::Base do
|
|
40
38
|
end
|
41
39
|
|
42
40
|
it 'should not record error on operator' do
|
43
|
-
errors.
|
41
|
+
expect(errors).not_to include(error)
|
44
42
|
end
|
45
43
|
end
|
46
44
|
|
@@ -50,7 +48,7 @@ describe Metasploit::Model::Search::Operation::Base do
|
|
50
48
|
end
|
51
49
|
|
52
50
|
it 'should record error on operator' do
|
53
|
-
errors.
|
51
|
+
expect(errors).to include(error)
|
54
52
|
end
|
55
53
|
end
|
56
54
|
end
|
@@ -61,7 +59,7 @@ describe Metasploit::Model::Search::Operation::Base do
|
|
61
59
|
end
|
62
60
|
|
63
61
|
it 'should not record error on operator' do
|
64
|
-
errors.
|
62
|
+
expect(errors).not_to include(error)
|
65
63
|
end
|
66
64
|
end
|
67
65
|
end
|