rspec-should 0.1.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +23 -0
- data/.github/workflows/documentation_coverage.yml +21 -0
- data/.github/workflows/rspec.yml +50 -0
- data/.github/workflows/rubocop.yml +19 -0
- data/.yardopts +7 -0
- data/CODE_OF_CONDUCT.md +183 -0
- data/Changelog.md +2 -0
- data/LICENSE.md +21 -0
- data/README.md +41 -0
- data/Rakefile +12 -0
- data/lib/rspec/should/enable.rb +3 -0
- data/lib/rspec/should/version.rb +11 -0
- data/lib/rspec/should.rb +168 -0
- data/script/bundle +13 -0
- data/script/check_documentation_coverage +39 -0
- data/script/functions.sh +10 -0
- data/script/update_rubygems_and_install_bundler +14 -0
- data.tar.gz.sig +0 -0
- metadata +97 -0
- metadata.gz.sig +3 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: ff2296a5887f54941734e5b32da9a387ae38a4e4c5c501e35c56806ec2e7af11
|
|
4
|
+
data.tar.gz: 93cef85dd585866edc8e7a1b55f6eaf37032efb150373697dbf6610de341e7fd
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 339630efb9b24f11de31741e0ad13d537973c20550a6ef2f10ed4a66620cba07d56020e38577ec5be7bf4967b5f671d27ce05df57419e97abe420537fdf4104f
|
|
7
|
+
data.tar.gz: 4c2cf5f78e955072f757d4064e473a6b1eaf4b6b3e554e1b63efa5373430096737b489f9520cfc3da703a190b38d1b23bffd35572a0091a01ade9afd33571d66
|
checksums.yaml.gz.sig
ADDED
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: RSpec CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- 'main'
|
|
7
|
+
- '*-maintenance'
|
|
8
|
+
pull_request:
|
|
9
|
+
branches:
|
|
10
|
+
- '*'
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
docs:
|
|
17
|
+
uses: ./.github/workflows/documentation_coverage.yml
|
|
18
|
+
|
|
19
|
+
rubocop:
|
|
20
|
+
uses: ./.github/workflows/rubocop.yml
|
|
21
|
+
|
|
22
|
+
specs:
|
|
23
|
+
uses: ./.github/workflows/rspec.yml
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Run Documentation Checks
|
|
2
|
+
on: workflow_call
|
|
3
|
+
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
RSPEC_CI: true
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
documentation_coverage:
|
|
12
|
+
name: Check documentation coverage for ${{ matrix.rspec_library }}
|
|
13
|
+
runs-on: 'ubuntu-latest'
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: ruby/setup-ruby@v1
|
|
17
|
+
with:
|
|
18
|
+
ruby-version: 4.0
|
|
19
|
+
- run: ./script/update_rubygems_and_install_bundler
|
|
20
|
+
- run: ./script/bundle
|
|
21
|
+
- run: ./script/check_documentation_coverage
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Run RSpec
|
|
2
|
+
on:
|
|
3
|
+
workflow_call:
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
RSPEC_CI: true
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
rspec:
|
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
|
14
|
+
runs-on: 'ubuntu-latest'
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
ruby:
|
|
18
|
+
- '4.0'
|
|
19
|
+
- '3.4'
|
|
20
|
+
- '3.3'
|
|
21
|
+
- '3.2'
|
|
22
|
+
- '3.1'
|
|
23
|
+
- '3.0'
|
|
24
|
+
fail-fast: false
|
|
25
|
+
continue-on-error: false
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: ruby/setup-ruby@v1
|
|
29
|
+
with:
|
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
|
31
|
+
- run: ./script/update_rubygems_and_install_bundler
|
|
32
|
+
- run: ./script/bundle
|
|
33
|
+
- run: ./bin/rspec
|
|
34
|
+
|
|
35
|
+
windows:
|
|
36
|
+
name: Ruby ${{ matrix.ruby }} (Windows)
|
|
37
|
+
runs-on: windows-latest
|
|
38
|
+
strategy:
|
|
39
|
+
matrix:
|
|
40
|
+
ruby:
|
|
41
|
+
- '3.4'
|
|
42
|
+
fail-fast: false
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
- uses: ruby/setup-ruby@v1
|
|
46
|
+
with:
|
|
47
|
+
ruby-version: ${{ matrix.ruby }}
|
|
48
|
+
bundler-cache: true
|
|
49
|
+
- run: choco install ansicon
|
|
50
|
+
- run: bundle exec rspec --backtrace
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Run Rubocop
|
|
2
|
+
on:
|
|
3
|
+
workflow_call:
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
rubocop:
|
|
10
|
+
name: Rubocop
|
|
11
|
+
runs-on: 'ubuntu-latest'
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: ruby/setup-ruby@v1
|
|
15
|
+
with:
|
|
16
|
+
ruby-version: 3.3
|
|
17
|
+
- run: script/update_rubygems_and_install_bundler
|
|
18
|
+
- run: script/bundle
|
|
19
|
+
- run: bin/rubocop
|
data/.yardopts
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Contributor Code of Conduct
|
|
2
|
+
|
|
3
|
+
For the purpose of building a welcoming, harassment-free community that
|
|
4
|
+
values contributions from anyone, the RSpec project has adopted the
|
|
5
|
+
following code of conduct. All contributors and participants (including
|
|
6
|
+
maintainers!) are expected to abide by its terms.
|
|
7
|
+
|
|
8
|
+
As contributors and maintainers of this project, we pledge to make our community
|
|
9
|
+
welcoming, safe, and equitable for all.
|
|
10
|
+
|
|
11
|
+
We are committed to fostering an environment that respects and promotes the
|
|
12
|
+
dignity, rights, and contributions of all individuals, regardless of
|
|
13
|
+
characteristics including race, ethnicity, caste, color, age, physical
|
|
14
|
+
characteristics, neurodiversity, disability, sex or gender, gender identity
|
|
15
|
+
or expression, sexual orientation, language, philosophy or religion, national
|
|
16
|
+
or social origin, socio-economic position, level of education, or other status.
|
|
17
|
+
The same privileges of participation are extended to everyone who participates
|
|
18
|
+
in good faith and in accordance with this Covenant.
|
|
19
|
+
|
|
20
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
|
21
|
+
fairly and consistently applying these principles to every aspect of managing
|
|
22
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
|
23
|
+
Conduct may be permanently removed from the project team.
|
|
24
|
+
|
|
25
|
+
## Encouraged Behaviors
|
|
26
|
+
|
|
27
|
+
While acknowledging differences in social norms, we all strive to meet our
|
|
28
|
+
community's expectations for positive behavior. We also understand that our
|
|
29
|
+
words and actions may be interpreted differently than we intend based on
|
|
30
|
+
culture, background, or native language.
|
|
31
|
+
|
|
32
|
+
With these considerations in mind, we agree to behave mindfully toward each
|
|
33
|
+
other and act in ways that center our shared values, including:
|
|
34
|
+
|
|
35
|
+
1. Respecting the **purpose of our community**, our activities,
|
|
36
|
+
and our ways of gathering.
|
|
37
|
+
2. Engaging **kindly and honestly** with others.
|
|
38
|
+
3. Respecting **different viewpoints** and experiences.
|
|
39
|
+
4. **Taking responsibility** for our actions and contributions.
|
|
40
|
+
5. Gracefully giving and accepting **constructive feedback**.
|
|
41
|
+
6. Committing to **repairing harm** when it occurs.
|
|
42
|
+
7. Behaving in other ways that promote and sustain the
|
|
43
|
+
**well-being of our community**.
|
|
44
|
+
|
|
45
|
+
## Restricted Behaviors
|
|
46
|
+
|
|
47
|
+
We agree to restrict the following behaviors in our community. Instances,
|
|
48
|
+
threats, and promotion of these behaviors are violations of this
|
|
49
|
+
Code of Conduct.
|
|
50
|
+
|
|
51
|
+
1. **Harassment.** Violating explicitly expressed boundaries or engaging in
|
|
52
|
+
unnecessary personal attention after any clear request to stop.
|
|
53
|
+
2. **Character attacks.** Making insulting, demeaning, or pejorative comments
|
|
54
|
+
directed at a community member or group of people.
|
|
55
|
+
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or
|
|
56
|
+
behavior on the basis of immutable identities or traits.
|
|
57
|
+
4. **Sexualization.** Behaving in a way that would generally be considered
|
|
58
|
+
inappropriately intimate in the context or purpose of the community.
|
|
59
|
+
5. **Violating confidentiality**. Sharing or acting on someone's personal or
|
|
60
|
+
private information without their permission.
|
|
61
|
+
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm
|
|
62
|
+
toward any person or group.
|
|
63
|
+
7. Behaving in other ways that **threaten the well-being** of our community.
|
|
64
|
+
|
|
65
|
+
### Other Restrictions
|
|
66
|
+
|
|
67
|
+
1. **Misleading identity.** Impersonating someone else for any reason, or
|
|
68
|
+
pretending to be someone else to evade enforcement actions.
|
|
69
|
+
2. **Failing to credit sources.** Not properly crediting the sources of content
|
|
70
|
+
you contribute, including but not limited to the use of LLMs.
|
|
71
|
+
3. **Promotional materials**. Sharing marketing or other commercial content in
|
|
72
|
+
a way that is outside the norms of the community.
|
|
73
|
+
4. **Irresponsible communication.** Failing to responsibly present content which
|
|
74
|
+
includes, links or describes any other restricted behaviors.
|
|
75
|
+
|
|
76
|
+
## Reporting an Issue
|
|
77
|
+
|
|
78
|
+
Tensions can occur between community members even when they are trying their
|
|
79
|
+
best to collaborate. Not every conflict represents a code of conduct violation,
|
|
80
|
+
and this Code of Conduct reinforces encouraged behaviors and norms that can
|
|
81
|
+
help avoid conflicts and minimize harm.
|
|
82
|
+
|
|
83
|
+
When an incident does occur, it is important to report it promptly.
|
|
84
|
+
|
|
85
|
+
To report a possible violation contact one of the project maintainers listed at
|
|
86
|
+
https://rspec.info/about/. All complaints will be reviewed and investigated
|
|
87
|
+
and will result in a response that is deemed necessary and appropriate to the
|
|
88
|
+
circumstances.
|
|
89
|
+
|
|
90
|
+
Maintainers take reports of violations seriously and will make every effort to
|
|
91
|
+
respond in a timely manner. They will investigate all reports of code of conduct
|
|
92
|
+
violations, reviewing messages, logs, and recordings, or interviewing witnesses
|
|
93
|
+
and other participants. Maintainers will keep investigation and enforcement
|
|
94
|
+
actions as transparent as possible while prioritizing safety and
|
|
95
|
+
confidentiality. In order to honor these values, enforcement actions are carried
|
|
96
|
+
out in private with the involved parties, but communicating to the whole
|
|
97
|
+
community may be part of a mutually agreed upon resolution.
|
|
98
|
+
|
|
99
|
+
## Addressing and Repairing Harm
|
|
100
|
+
|
|
101
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
102
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
103
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
104
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
105
|
+
threatening, offensive, or harmful.
|
|
106
|
+
|
|
107
|
+
If an investigation that this Code of Conduct has been violated, the following
|
|
108
|
+
enforcement ladder may be used to determine how best to repair harm, based on
|
|
109
|
+
the incident's impact on the individuals involved and the community as a whole.
|
|
110
|
+
Depending on the severity of a violation, lower rungs on the ladder may be
|
|
111
|
+
skipped.
|
|
112
|
+
|
|
113
|
+
1) Warning
|
|
114
|
+
1) Event: A violation involving a single incident or series of incidents.
|
|
115
|
+
2) Consequence: A private, written warning.
|
|
116
|
+
3) Repair: Examples of repair include a private written apology,
|
|
117
|
+
acknowledgement of responsibility, and seeking clarification on
|
|
118
|
+
expectations.
|
|
119
|
+
|
|
120
|
+
2) Temporarily Limited Activities
|
|
121
|
+
1) Event: A repeated incidence of a violation that previously resulted in a
|
|
122
|
+
warning, or the first incidence of a more serious violation.
|
|
123
|
+
2) Consequence: A private, written warning with a time-limited cooldown
|
|
124
|
+
period designed to underscore the seriousness of the situation and give
|
|
125
|
+
the community members involved time to process the incident. The cooldown
|
|
126
|
+
period may be limited to particular communication channels or interactions
|
|
127
|
+
with particular community members.
|
|
128
|
+
3) Repair: Examples of repair may include making an apology, using the
|
|
129
|
+
cooldown period to reflect on actions and impact, and being thoughtful
|
|
130
|
+
about re-entering community spaces after the period is over.
|
|
131
|
+
|
|
132
|
+
3) Temporary Suspension
|
|
133
|
+
1) Event: A pattern of repeated violation which have been issued warnings,
|
|
134
|
+
or a single serious violation.
|
|
135
|
+
2) Consequence: A private written warning with conditions for return from
|
|
136
|
+
suspension. In general, temporary suspensions give the person being
|
|
137
|
+
suspended time to reflect upon their behavior and possible corrective
|
|
138
|
+
actions.
|
|
139
|
+
3) Repair: Examples of repair include respecting the spirit of the
|
|
140
|
+
suspension, meeting the specified conditions for return, and being
|
|
141
|
+
thoughtful about how to reintegrate with the community when the suspension
|
|
142
|
+
is lifted.
|
|
143
|
+
|
|
144
|
+
4) Permanent Ban
|
|
145
|
+
1) Event: A pattern of repeated code of conduct violations that other steps
|
|
146
|
+
on the ladder have failed to resolve, or a violation so serious that it
|
|
147
|
+
is determined there is no way to keep the community safe with this person
|
|
148
|
+
as a member.
|
|
149
|
+
2) Consequence: Access to all community spaces, tools, and communication
|
|
150
|
+
channels is removed. In general, permanent bans should be rarely used,
|
|
151
|
+
should have strong reasoning behind them, and should only be resorted to
|
|
152
|
+
if working through other remedies has failed to change the behavior.
|
|
153
|
+
3) Repair: There is no possible repair in cases of this severity.
|
|
154
|
+
|
|
155
|
+
This enforcement ladder is intended as a guideline. It does not limit the
|
|
156
|
+
ability of maintainers to use their discretion and judgment, in keeping
|
|
157
|
+
with the best interests of our community.
|
|
158
|
+
|
|
159
|
+
## Scope
|
|
160
|
+
|
|
161
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
162
|
+
an individual is officially representing the community in public or other
|
|
163
|
+
spaces. Examples of representing our community include using an official email
|
|
164
|
+
address, posting via an official social media account, or acting as an appointed
|
|
165
|
+
representative at an online or offline event.
|
|
166
|
+
|
|
167
|
+
## Attribution
|
|
168
|
+
|
|
169
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
170
|
+
version 3.0, available at
|
|
171
|
+
[https://www.contributor-covenant.org/version/3/0/][version]
|
|
172
|
+
|
|
173
|
+
Contributor Covenant is stewarded by the Organization for Ethical Source and
|
|
174
|
+
licensed under CC BY-SA 4.0. To view a copy of this license, visit
|
|
175
|
+
[https://creativecommons.org/licenses/by-sa/4.0/][cc-by-sa]
|
|
176
|
+
|
|
177
|
+
For answers to common questions about Contributor Covenant, see their
|
|
178
|
+
[FAQ][faq].
|
|
179
|
+
|
|
180
|
+
[cc-by-sa]: https://creativecommons.org/licenses/by-sa/4.0/
|
|
181
|
+
[homepage]: https://contributor-covenant.org
|
|
182
|
+
[faq]: https://www.contributor-covenant.org/faq
|
|
183
|
+
[version]: https://www.contributor-covenant.org/version/3/0/
|
data/Changelog.md
ADDED
data/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The RSpec Development Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# RSpec::Should
|
|
2
|
+
|
|
3
|
+
This gem re-enables the `.should` syntax for RSpec gems (>= 4.0.0).
|
|
4
|
+
|
|
5
|
+
Please note that the RSpec team does not recommend this gem, we instead recommend the `expect` syntax.
|
|
6
|
+
|
|
7
|
+
## Why switch over from `should` to `expect`
|
|
8
|
+
The `should` and `should_not` methods work by being added to every object. However, RSpec
|
|
9
|
+
does not own every object and cannot ensure they work consistently on every object.
|
|
10
|
+
In particular, they can lead to surprising failures when used with BasicObject-subclassed
|
|
11
|
+
proxy objects.
|
|
12
|
+
|
|
13
|
+
`expect` avoids these problems altogether by not needing to be available on all objects.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Install the gem and add to the application's Gemfile by executing:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bundle add rspec-should
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
gem install rspec-should
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then either require `rspec/should/enable` or manually call `RSpec::Should.enable!` at your desired time.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
See the documentation in RSpec::Should.
|
|
34
|
+
|
|
35
|
+
## Contributing
|
|
36
|
+
|
|
37
|
+
This gem is considered legacy support, whilst bug reports are welcome, there is no guarantee a member of
|
|
38
|
+
the RSpec team will have time to attend to the issue. If you use this gem and encounter issues, please try
|
|
39
|
+
to fix them yourself and submit a pull request.
|
|
40
|
+
|
|
41
|
+
Contributors are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/lib/rspec/should.rb
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Namespace for all RSpec code.
|
|
4
|
+
module RSpec
|
|
5
|
+
# RSpec::Should provides the original `should` and `should_not` syntax for RSpec >= 4.
|
|
6
|
+
#
|
|
7
|
+
# From the beginning RSpec provided `should` and `should_not` methods
|
|
8
|
+
# to define expectations on any object. In version 2.11 `expect` method was
|
|
9
|
+
# introduced which became the recommended way to define expectations on an object.
|
|
10
|
+
#
|
|
11
|
+
# ### Why switch over from `should` to `expect`
|
|
12
|
+
#
|
|
13
|
+
# #### Fix edge case issues
|
|
14
|
+
#
|
|
15
|
+
# `should` and `should_not` work by being added to every object. However, RSpec
|
|
16
|
+
# does not own every object and cannot ensure they work consistently on every object.
|
|
17
|
+
# In particular, they can lead to surprising failures when used with BasicObject-subclassed
|
|
18
|
+
# proxy objects.
|
|
19
|
+
#
|
|
20
|
+
# `expect` avoids these problems altogether by not needing to be available on all objects.
|
|
21
|
+
#
|
|
22
|
+
# #### Unification of block and value syntaxes
|
|
23
|
+
#
|
|
24
|
+
# Before version 2.11 `expect` was just a more readable alternative for block
|
|
25
|
+
# expectations. Since version 2.11 `expect` can be used for both block and value
|
|
26
|
+
# expectations.
|
|
27
|
+
#
|
|
28
|
+
# ```ruby
|
|
29
|
+
# expect(actual).to eq(expected)
|
|
30
|
+
# expect { ... }.to raise_error(ErrorClass)
|
|
31
|
+
# ```
|
|
32
|
+
#
|
|
33
|
+
# See [http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax](http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax)
|
|
34
|
+
# For a detailed explanation
|
|
35
|
+
#
|
|
36
|
+
# ## Usage
|
|
37
|
+
# The `should` and `should_not` methods can be used to define expectations on any object.
|
|
38
|
+
#
|
|
39
|
+
# ```ruby
|
|
40
|
+
# actual.should eq expected
|
|
41
|
+
# actual.should be > 3
|
|
42
|
+
# [1, 2, 3].should_not include 4
|
|
43
|
+
# ```
|
|
44
|
+
#
|
|
45
|
+
# ## Using Built-in matchers
|
|
46
|
+
#
|
|
47
|
+
# ### Equivalence
|
|
48
|
+
# ```ruby
|
|
49
|
+
# actual.should eq(expected) # passes if actual == expected
|
|
50
|
+
# actual.should == expected # passes if actual == expected
|
|
51
|
+
# actual.should_not eql(expected) # passes if actual.eql?(expected)
|
|
52
|
+
# ```
|
|
53
|
+
#
|
|
54
|
+
# Note: we recommend the `eq` matcher over `==` to avoid Ruby's "== in a
|
|
55
|
+
# useless context" warning when the `==` matcher is used anywhere but the
|
|
56
|
+
# last statement of an example.
|
|
57
|
+
#
|
|
58
|
+
# ### Identity
|
|
59
|
+
#
|
|
60
|
+
# ```ruby
|
|
61
|
+
# actual.should be(expected) # passes if actual.equal?(expected)
|
|
62
|
+
# actual.should_not equal(expected) # passes if actual.equal?(expected)
|
|
63
|
+
# ```
|
|
64
|
+
#
|
|
65
|
+
# ### Comparisons
|
|
66
|
+
#
|
|
67
|
+
# ```ruby
|
|
68
|
+
# actual.should be > expected
|
|
69
|
+
# actual.should be >= expected
|
|
70
|
+
# actual.should be <= expected
|
|
71
|
+
# actual.should be < expected
|
|
72
|
+
# actual.should be_within(delta).of(expected)
|
|
73
|
+
# ```
|
|
74
|
+
#
|
|
75
|
+
# ### Regular expressions
|
|
76
|
+
#
|
|
77
|
+
# ```ruby
|
|
78
|
+
# actual.should match(/expression/)
|
|
79
|
+
# actual.should =~ /expression/
|
|
80
|
+
# ```
|
|
81
|
+
#
|
|
82
|
+
# ### Types/classes
|
|
83
|
+
#
|
|
84
|
+
# ```ruby
|
|
85
|
+
# actual.should be_an_instance_of(expected)
|
|
86
|
+
# actual.should_not be_a_kind_of(expected)
|
|
87
|
+
# ```
|
|
88
|
+
#
|
|
89
|
+
# ### Truthiness
|
|
90
|
+
#
|
|
91
|
+
# ```ruby
|
|
92
|
+
# actual.should be_true # passes if actual is truthy (not nil or false)
|
|
93
|
+
# actual.should be_false # passes if actual is falsy (nil or false)
|
|
94
|
+
# actual.should be_nil # passes if actual is nil
|
|
95
|
+
# ```
|
|
96
|
+
#
|
|
97
|
+
# ### Predicate matchers
|
|
98
|
+
#
|
|
99
|
+
# ```ruby
|
|
100
|
+
# actual.should be_xxx # passes if actual.xxx?
|
|
101
|
+
# actual.should_not have_xxx(:arg) # passes if actual.has_xxx?(:arg)
|
|
102
|
+
# ```
|
|
103
|
+
#
|
|
104
|
+
# ### Ranges (Ruby >= 1.9 only)
|
|
105
|
+
#
|
|
106
|
+
# ```ruby
|
|
107
|
+
# (1..10).should cover(3)
|
|
108
|
+
# ```
|
|
109
|
+
#
|
|
110
|
+
# ### Collection membership
|
|
111
|
+
#
|
|
112
|
+
# ```ruby
|
|
113
|
+
# actual.should include(expected)
|
|
114
|
+
# actual.should start_with(expected)
|
|
115
|
+
# actual.should end_with(expected)
|
|
116
|
+
# ```
|
|
117
|
+
#
|
|
118
|
+
# #### Examples
|
|
119
|
+
#
|
|
120
|
+
# ```ruby
|
|
121
|
+
# [1,2,3].should include(1)
|
|
122
|
+
# [1,2,3].should include(1, 2)
|
|
123
|
+
# [1,2,3].should start_with(1)
|
|
124
|
+
# [1,2,3].should start_with(1,2)
|
|
125
|
+
# [1,2,3].should end_with(3)
|
|
126
|
+
# [1,2,3].should end_with(2,3)
|
|
127
|
+
# {:a => 'b'}.should include(:a => 'b')
|
|
128
|
+
# "this string".should include("is str")
|
|
129
|
+
# "this string".should start_with("this")
|
|
130
|
+
# "this string".should end_with("ring")
|
|
131
|
+
# ```
|
|
132
|
+
module Should
|
|
133
|
+
module_function
|
|
134
|
+
|
|
135
|
+
# Enables the `should` syntax on the default host (Object's last ancestor).
|
|
136
|
+
def enable!
|
|
137
|
+
enable_should(default_should_host)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @api private
|
|
141
|
+
# Determines where we add `should` and `should_not`.
|
|
142
|
+
def default_should_host
|
|
143
|
+
@default_should_host ||= ::Object.ancestors.last
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @api private
|
|
147
|
+
# Enables the `should` syntax.
|
|
148
|
+
def enable_should(syntax_host = default_should_host)
|
|
149
|
+
return if should_enabled?(syntax_host)
|
|
150
|
+
|
|
151
|
+
syntax_host.module_exec do
|
|
152
|
+
def should(matcher = nil, message = nil, &block)
|
|
153
|
+
::RSpec::Expectations::PositiveExpectationHandler.handle_matcher(self, matcher, message, &block)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def should_not(matcher = nil, message = nil, &block)
|
|
157
|
+
::RSpec::Expectations::NegativeExpectationHandler.handle_matcher(self, matcher, message, &block)
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# @api private
|
|
163
|
+
# Indicates whether or not the `should` syntax is enabled.
|
|
164
|
+
def should_enabled?(syntax_host = default_should_host)
|
|
165
|
+
syntax_host.method_defined?(:should)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
data/script/bundle
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
set -e
|
|
2
|
+
|
|
3
|
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
4
|
+
source $SCRIPT_DIR/functions.sh
|
|
5
|
+
|
|
6
|
+
echo "Set bundle path to .bundle/gems"
|
|
7
|
+
bundle config set --local path '.bundle/gems'
|
|
8
|
+
|
|
9
|
+
echo "bundle install --standalone"
|
|
10
|
+
bundle install --standalone
|
|
11
|
+
|
|
12
|
+
echo "bundle binstubs --all --standalone"
|
|
13
|
+
bundle binstubs --all --standalone
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
set -e
|
|
2
|
+
|
|
3
|
+
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
|
4
|
+
SCRIPT_DIR="${ROOT_DIR}/script"
|
|
5
|
+
source $SCRIPT_DIR/functions.sh
|
|
6
|
+
|
|
7
|
+
echo "bin/yard stats --list-undoc"
|
|
8
|
+
|
|
9
|
+
$ROOT_DIR/bin/yard stats --list-undoc | ruby -e "
|
|
10
|
+
while line = gets
|
|
11
|
+
has_warnings ||= line.start_with?('[warn]:')
|
|
12
|
+
coverage ||= line[/([\d\.]+)% documented/, 1]
|
|
13
|
+
puts line
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
unless Float(coverage) == 100
|
|
17
|
+
puts \"\n\nMissing documentation coverage (currently at #{coverage}%)\"
|
|
18
|
+
exit(1)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
if has_warnings
|
|
22
|
+
puts \"\n\nYARD emitted documentation warnings.\"
|
|
23
|
+
exit(1)
|
|
24
|
+
end
|
|
25
|
+
"
|
|
26
|
+
|
|
27
|
+
# Some warnings only show up when generating docs, so do that as well.
|
|
28
|
+
$ROOT_DIR/bin/yard doc --no-cache | ruby -e "
|
|
29
|
+
while line = gets
|
|
30
|
+
has_warnings ||= line.start_with?('[warn]:')
|
|
31
|
+
has_errors ||= line.start_with?('[error]:')
|
|
32
|
+
puts line
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
if has_warnings || has_errors
|
|
36
|
+
puts \"\n\nYARD emitted documentation warnings or errors.\"
|
|
37
|
+
exit(1)
|
|
38
|
+
end
|
|
39
|
+
"
|
data/script/functions.sh
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
set -e
|
|
2
|
+
|
|
3
|
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
4
|
+
source $SCRIPT_DIR/functions.sh
|
|
5
|
+
|
|
6
|
+
if is_ruby_31_plus; then
|
|
7
|
+
echo "Installing most recent rubygems / bundler"
|
|
8
|
+
yes | gem update --no-document --system
|
|
9
|
+
yes | gem install --no-document bundler
|
|
10
|
+
else
|
|
11
|
+
echo "Installing rubygems 3.2.22 / bundler 2.2.22"
|
|
12
|
+
yes | gem update --system '3.2.22'
|
|
13
|
+
yes | gem install bundler -v '2.2.22'
|
|
14
|
+
fi
|
data.tar.gz.sig
ADDED
|
Binary file
|
metadata
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: rspec-should
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0.beta1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jon Rowe
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain:
|
|
10
|
+
- |
|
|
11
|
+
-----BEGIN CERTIFICATE-----
|
|
12
|
+
MIIFvjCCA6agAwIBAgIJAPXjfUbCjdXWMA0GCSqGSIb3DQEBCwUAMIGAMQswCQYD
|
|
13
|
+
VQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEO
|
|
14
|
+
MAwGA1UECgwFUlNwZWMxEzARBgNVBAMMCnJzcGVjLmluZm8xJTAjBgkqhkiG9w0B
|
|
15
|
+
CQEWFnJzcGVjQGdvb2dsZWdyb3Vwcy5jb20wHhcNMjYwMjE3MTE0ODM0WhcNMjcw
|
|
16
|
+
MjE3MTE0ODM0WjCBgDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24x
|
|
17
|
+
EDAOBgNVBAcMB1NlYXR0bGUxDjAMBgNVBAoMBVJTcGVjMRMwEQYDVQQDDApyc3Bl
|
|
18
|
+
Yy5pbmZvMSUwIwYJKoZIhvcNAQkBFhZyc3BlY0Bnb29nbGVncm91cHMuY29tMIIC
|
|
19
|
+
IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsSmjgcHaKlD0jizRJowi2bGI
|
|
20
|
+
KMOHnJoExxRNHHxH+3w9kkl95YldvDRVX495b13ZCzwRe0AyqX24wq04tp0G5Z5C
|
|
21
|
+
e/w2pnNK4ol1eECPwQu+YGpepeODlZICL5gwQspe0cDifbBnHx5QySMiPpvx6bC0
|
|
22
|
+
tQTox0ppDIaMhch8IPCwyoE4DQK5bpsdwnLSHTsQjUIb7IM8tUMpd/iKrJgNffwc
|
|
23
|
+
6gC1TmhIlzQoB26nCNh9uK7xZjUM+sGECzvcYuImchUaIgJA/ybrlZS+m/hxzvBo
|
|
24
|
+
mLnn/xNEC6Vz5HG+3TR0Gb0cSUf6XUu2s51Jk/SJi3MhCZp2gs9OUg4EVZNzQVkZ
|
|
25
|
+
efLBjAZG2Mxk14JyB4/Omc+Jk0ajprINCBbUNnxzCJrYDM3J9TVWIwyUGNX/U3MO
|
|
26
|
+
s3tMAT+EVgx/mZMPnBO8EULlyF51MRUp3Wy9Mnw8AYLk30UnMG5AjqgO5JNyFlA7
|
|
27
|
+
Xeh3EVdWY3vMB1pkhPwlsenpcmj5gOzrd54lELOVbCGHCf48iSqeflY2Lhe0pvzK
|
|
28
|
+
blXCJBDmtrebvus291rM/dHcbEfK1SVd5Wut/n131iouf6dnNCFskFygDcgBbthC
|
|
29
|
+
gpEMqf80lEmhX59VUsm0Pv6OEo+ZPHBvXPiJA6DShQh9t3YtpwyA8uVDMbT/i32u
|
|
30
|
+
2FUsqZbbJcCmkBrGposCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
|
31
|
+
HQYDVR0OBBYEFPPvQ5XT0Nvuhi6k+hrWVv35J+TeMA0GCSqGSIb3DQEBCwUAA4IC
|
|
32
|
+
AQBaeeGIZtBFDP33D1/4sXldSgwntVcL5qC5pcjamLWM4HK4/a6ePMy1uoX+dEnJ
|
|
33
|
+
J+BjZWURsUfFOob+xnUe8AMSbv9gupckfVehZoBzOvJDaWcALo8GKjJlmVtzEIqZ
|
|
34
|
+
TvBLO5zQwR4cWIrg0NWjkDOSQOrNNQ2Degv/aOFrR8dFPJSgxZG/IC0/t6s72cEt
|
|
35
|
+
V4SIe/NLIU4RyBzfgn/RBsalDEF1yIVlDWspMa78clS3bPmntkNyfLwIUwINDHhn
|
|
36
|
+
swFA8bEKMQWqRlupuRmEiy3nGe6az46YlPXzK5UWfXJ6Lb1wIE8W80TRx0HpSC7j
|
|
37
|
+
JfXPfQ0PLgiU4nnQqain2bIn96Ooco8kspeqp8rSJ8sbaMPTNmcFuwD3gzWsRnJ3
|
|
38
|
+
rIaJbmrUcq6DlJ7jfv3u5TPt4JWzDP7oDPf3nXNiF2Cn48Ne598G5lHH6Heyxe39
|
|
39
|
+
pYZdhEptKJWPHxbJWHXD02omKprkNuQKHpnXrW+mmbiO4IcqAMggiud+DaEQg20x
|
|
40
|
+
Dae4cNbvK5p3D+5xqvcEO2G4uCMDmJjrSd61kvTLBnm1qroHqrpi9GauEVWZZmD0
|
|
41
|
+
n0ph8oFAXOsKQWxZ+4uh6yGISk+WhngCZEVPZUjq7SIGAuVhQy2ZgwdjnLEz//lD
|
|
42
|
+
x0Qexp5yGeoxAL9qKM/RXYKtuRZBJV1z+L9A1YOtwaXXNg==
|
|
43
|
+
-----END CERTIFICATE-----
|
|
44
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
45
|
+
dependencies: []
|
|
46
|
+
description: "`should` syntax for RSpec 4.0.x"
|
|
47
|
+
email: rspec@googlegroups.com
|
|
48
|
+
executables: []
|
|
49
|
+
extensions: []
|
|
50
|
+
extra_rdoc_files: []
|
|
51
|
+
files:
|
|
52
|
+
- ".github/workflows/ci.yml"
|
|
53
|
+
- ".github/workflows/documentation_coverage.yml"
|
|
54
|
+
- ".github/workflows/rspec.yml"
|
|
55
|
+
- ".github/workflows/rubocop.yml"
|
|
56
|
+
- ".yardopts"
|
|
57
|
+
- CODE_OF_CONDUCT.md
|
|
58
|
+
- Changelog.md
|
|
59
|
+
- LICENSE.md
|
|
60
|
+
- README.md
|
|
61
|
+
- Rakefile
|
|
62
|
+
- lib/rspec/should.rb
|
|
63
|
+
- lib/rspec/should/enable.rb
|
|
64
|
+
- lib/rspec/should/version.rb
|
|
65
|
+
- script/bundle
|
|
66
|
+
- script/check_documentation_coverage
|
|
67
|
+
- script/functions.sh
|
|
68
|
+
- script/update_rubygems_and_install_bundler
|
|
69
|
+
homepage: https://rspec.info
|
|
70
|
+
licenses:
|
|
71
|
+
- MIT
|
|
72
|
+
metadata:
|
|
73
|
+
bug_tracker_uri: https://github.com/rspec/rspec-should/issues
|
|
74
|
+
changelog_uri: https://github.com/rspec/rspec-should/tree/v0.1.0.beta1/Changelog.md
|
|
75
|
+
documentation_uri: https://rspec.info/documentation/
|
|
76
|
+
homepage_uri: https://rspec.info
|
|
77
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
|
78
|
+
rubygems_mfa_required: 'true'
|
|
79
|
+
source_code_uri: https://github.com/rspec/rspec-should
|
|
80
|
+
rdoc_options: []
|
|
81
|
+
require_paths:
|
|
82
|
+
- lib
|
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
|
+
requirements:
|
|
85
|
+
- - ">="
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: 3.0.0
|
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
|
+
requirements:
|
|
90
|
+
- - ">="
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
version: '0'
|
|
93
|
+
requirements: []
|
|
94
|
+
rubygems_version: 4.0.6
|
|
95
|
+
specification_version: 4
|
|
96
|
+
summary: rspec-should-0.1.0.beta1
|
|
97
|
+
test_files: []
|
metadata.gz.sig
ADDED