Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

WIP: Merge rspec expectations #2665

Closed
wants to merge 2,383 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2383 commits
Select commit Hold shift + click to select a range
5ce908e
Clarify what happened in error message.
alexaltair Mar 31, 2016
d6eac40
Merge pull request #908 from alexaltair/master
JonRowe Apr 1, 2016
321b437
changelog for #908
JonRowe Apr 1, 2016
1f10c81
Temporarily set version for release of 3.5.0.beta3
Apr 2, 2016
d5b6b35
Revert "Temporarily set version for release of 3.5.0.beta3"
Apr 2, 2016
a2ca39c
Updated travis build scripts (from rspec-dev)
JonRowe Apr 30, 2016
1d17174
use ruby 2.3.1
JonRowe May 3, 2016
2557bff
limit bundler version
JonRowe May 3, 2016
40a12ca
Merge pull request #909 from rspec/update-travis-build-scripts-2016-0…
JonRowe May 4, 2016
d630ff3
Updated travis build scripts (from rspec-dev)
JonRowe May 4, 2016
580c199
Merge pull request #910 from rspec/update-travis-build-scripts-2016-0…
JonRowe May 4, 2016
fcac77c
Updated travis build scripts (from rspec-dev)
JonRowe May 6, 2016
582f5db
Merge pull request #911 from rspec/update-travis-build-scripts-2016-0…
JonRowe May 6, 2016
d6a75c6
Updated travis build scripts (from rspec-dev)
JonRowe May 9, 2016
47cd9a3
Merge pull request #912 from rspec/update-travis-build-scripts-2016-0…
JonRowe May 9, 2016
c1b242d
Updated travis build scripts (from rspec-dev)
JonRowe May 11, 2016
ad4b976
Merge pull request #914 from rspec/update-travis-build-scripts-2016-0…
JonRowe May 12, 2016
402075b
Specify keyword arguments for #respond_to matcher
sleepingkingstudios Oct 1, 2015
fd34c98
Refactor error messaging to fix Rubocop violations.
sleepingkingstudios Oct 9, 2015
3716f0a
Specify "unlimited arguments" and "any keywords" expectations.
sleepingkingstudios Oct 9, 2015
83246d5
Specify argument count range for #respond_to matcher.
sleepingkingstudios Nov 4, 2015
dbefeeb
Update syntax for optional SignatureVerifier argument.
sleepingkingstudios May 27, 2016
47e4883
Remove redundant RespondTo return.
sleepingkingstudios May 27, 2016
42da529
Fix include matcher so that it provides a valid diff for hashes
yujinakayama May 8, 2016
ce9f25d
Merge pull request #916 from rspec/fix-include-matcher-diff-with-hashes
JonRowe May 29, 2016
8693ecb
Fix diffing regression introduced by #916.
myronmarston May 31, 2016
93ab745
Merge pull request #918 from rspec/myron/916-followups
JonRowe May 31, 2016
1500d21
Update changelog to reflect 3.5.0 beta releases.
myronmarston May 31, 2016
12c30ab
Release v3.5.0.beta4
myronmarston Jun 5, 2016
4c3fc3d
Revert version to 3.5.0.pre
myronmarston Jun 5, 2016
ace328f
Updated travis build scripts (from rspec-dev)
myronmarston Jun 5, 2016
56a7598
Merge pull request #919 from rspec/update-travis-build-scripts-2016-0…
JonRowe Jun 6, 2016
599af8c
Merge pull request #915 from sleepingkingstudios/respond_to-keyword-a…
JonRowe Jun 14, 2016
f2e2130
Add Cucumber features for new RespondTo matcher methods. (#921)
sleepingkingstudios Jun 15, 2016
d1b5c1c
Updated travis build scripts (from rspec-dev) (#922)
myronmarston Jun 15, 2016
501a513
Attempt to work around weird 1.8.7 warning that showed up on travis: …
myronmarston Jun 15, 2016
7fe87ce
Bump version to 3.5.0
Jul 1, 2016
a188862
Add changelog entry for v3.5.0
Jul 1, 2016
c651a7b
Bump version to 3.6.0.pre
Jul 1, 2016
00c895b
Kill rubocop rake task.
myronmarston Jul 1, 2016
3e0f955
Updates from rspec-dev (2016-07-14) (#930)
JonRowe Jul 18, 2016
a271631
Update json comment
JonRowe Jul 18, 2016
bebc269
composable, dont enumarate sets
Sep 5, 2016
7a3f8f9
Revise the fix from #939 to work a bit better.
myronmarston Sep 5, 2016
4f90919
Merge pull request #940 from rspec/myron/939-fixups
myronmarston Sep 6, 2016
29bfb9f
changelog for #915
JonRowe Jun 15, 2016
f844776
remove erroneous statement in changelog
JonRowe Sep 6, 2016
62e9985
switch gsub for tr, performs better
JonRowe Sep 6, 2016
6d880e1
remove allocation of lambda for differ object preparer
JonRowe Sep 6, 2016
2ebd28a
Merge pull request #941 from rspec/alt_reduce_allocations
JonRowe Sep 7, 2016
2479fc6
switch git from git to https
JonRowe Sep 12, 2016
add9b27
Merge pull request #942 from rspec/change_git_to_https
JonRowe Sep 12, 2016
4336dd5
Updated common markdown files (from rspec-dev) [ci skip]
JonRowe Sep 28, 2016
8343aff
Merge pull request #945 from rspec/update-common-markdown-files-2016-…
JonRowe Sep 28, 2016
5fdcfe8
Fix Typo
gaurish Oct 10, 2016
7ebdbe0
Merge pull request #949 from gaurish/patch-1
JonRowe Oct 10, 2016
f07af78
Release 3.6.0.beta1
myronmarston Oct 10, 2016
fb7f461
Add configuration for max object formatter length
Nov 3, 2016
b02d58e
Updated travis build scripts (from rspec-dev)
yujinakayama Nov 6, 2016
4d3a2cd
Merge pull request #952 from rspec/update-travis-build-scripts-2016-1…
yujinakayama Nov 6, 2016
9cbb219
Updated travis build scripts (from rspec-dev)
yujinakayama Nov 7, 2016
967d44c
Merge pull request #953 from rspec/update-travis-build-scripts-2016-1…
JonRowe Nov 7, 2016
91fe90c
prevent warning when exists matcher is used with files
JonRowe Nov 10, 2016
2039e7e
Merge pull request #954 from rspec/prevent_warning_from_file_exists
myronmarston Nov 13, 2016
40b61c4
Change log for #954
JonRowe Nov 13, 2016
303e3f3
Updated travis build scripts (from rspec-dev)
JonRowe Nov 18, 2016
a106ff8
Merge pull request #955 from rspec/update-travis-build-scripts-2016-1…
JonRowe Nov 21, 2016
2e6587f
Updated travis build scripts (from rspec-dev)
JonRowe Nov 22, 2016
55160d7
Merge pull request #956 from rspec/update-travis-build-scripts-2016-1…
JonRowe Nov 23, 2016
f6a0342
Release v3.6.0.beta2
myronmarston Dec 12, 2016
69bd756
Ensure rubocop does not install on Ruby 2.4.
myronmarston Dec 27, 2016
2b04f95
Address Fixnum changes in Ruby 2.4.
myronmarston Dec 27, 2016
7f1ed3f
Merge pull request #961 from rspec/myron/ruby-2-4
myronmarston Dec 27, 2016
e58627b
Updated travis build scripts (from rspec-dev)
myronmarston Dec 27, 2016
6d86a38
Merge pull request #962 from rspec/update-travis-build-scripts-2016-1…
JonRowe Dec 27, 2016
df71ca4
Limit rainbow on 1.9.2
JonRowe Jan 6, 2017
61d79c6
Instead run rubocop on a newer ruby
JonRowe Jan 7, 2017
df5079c
Merge pull request #963 from rspec/fix_192
JonRowe Jan 9, 2017
ff1d0ca
pin ffi on 1.8 and 1.9 on windows
JonRowe Jan 17, 2017
e931019
Merge pull request #966 from rspec/fix_windows_192_build
JonRowe Jan 17, 2017
f94bb58
readme: add missing syntax highlighting
alyssais Jan 17, 2017
e6868c3
Merge pull request #967 from alyssais/patch-1
myronmarston Jan 17, 2017
cd1c8b8
Correct "its" vs "it's" grammar errors.
ajdlp Feb 2, 2017
4f5beb9
Correct 'a' vs 'an' grammar mistake.
ajdlp Feb 2, 2017
c5bb6ca
Merge pull request #970 from ajdlp/grammar-errors
JonRowe Feb 2, 2017
6caa898
Changelog for #972
JonRowe Feb 16, 2017
2185f90
Treat no method errors as not comparable
JonRowe Feb 16, 2017
f1d8031
Merge pull request #972 from rspec/fix_comparison_matchers
JonRowe Feb 16, 2017
98eab0c
Move `alias_matcher` and `define_negated_matcher` to `RSpec::Matchers…
reitermarkus Feb 18, 2017
61637c6
Add feature for scoped `alias_matcher`.
reitermarkus Feb 18, 2017
92c7fc4
Move parts of the docs for `alias_matcher` back.
reitermarkus Feb 19, 2017
6838798
Move parts of the docs for `define_negated_matcher` back.
reitermarkus Feb 19, 2017
0cf3003
Move `extend RSpec::Matchers::DSL` into `RSpec::Matchers`.
reitermarkus Feb 19, 2017
4f31c7f
Replace cuke with specs.
reitermarkus Feb 19, 2017
962ae27
Add @param and @yield to `DSL#define`.
reitermarkus Feb 19, 2017
9c0af22
Add extended class methods to `RSpec::Matchers`.
reitermarkus Feb 19, 2017
45ab646
Merge pull request #974 from reitermarkus/scoped-alias-negated-matchers
myronmarston Feb 24, 2017
c418b9e
Post-merge cleanup for #974.
myronmarston Feb 24, 2017
5638efe
Merge pull request #975 from rspec/myron/974-followups
myronmarston Feb 24, 2017
c566978
Change the `warn_about_negative_false_positive` message
koic Mar 5, 2017
82ab90b
Merge pull request #977 from koic/change_warn_about_negative_false_po…
xaviershay Mar 5, 2017
e7ffd01
yield_with_args: match immediately (#965)
alyssais Mar 21, 2017
cd3d6a1
Changelog for #965.
myronmarston Mar 21, 2017
255ea46
Fix regression introduced in #965. (#981)
myronmarston Apr 9, 2017
c32d7ff
Updated travis build scripts (from rspec-dev)
JonRowe Apr 10, 2017
aab6c1f
Merge pull request #982 from rspec/update-travis-build-scripts-2017-0…
JonRowe Apr 10, 2017
3461255
Fix incorrect comment in docs.
xaviershay Apr 27, 2017
0ad53b7
Merge pull request #986 from rspec/fix-doc
JonRowe Apr 28, 2017
2dfb196
Implement BlockSnippetExtractor
yujinakayama May 3, 2017
2fd8a53
Organize #change matcher spec structure
yujinakayama May 3, 2017
65cb794
Include block snippet in failure message of #change matcher with block
yujinakayama May 3, 2017
da96064
Include block snippet in failure message of #satisfy matcher
yujinakayama May 3, 2017
a0146e7
Add pending spec for block snippet extraction with #change matcher alias
yujinakayama May 3, 2017
41869a2
Merge pull request #987 from rspec/extract-block-snippet
yujinakayama May 4, 2017
9f72ce3
Add BaseMatcher#matcher_name and set it in DSL#alias_matcher
yujinakayama May 4, 2017
8b81a0e
Support block snippet extraction with aliases of #change and #satisfy
yujinakayama May 4, 2017
a72cb50
Merge pull request #988 from rspec/support-block-snippet-extraction-w…
yujinakayama May 4, 2017
dd71890
Fix NoMethodError raised with &:symbol proc in #change and #satisfy
yujinakayama May 4, 2017
0f5d55b
Remove unneeded assertion
yujinakayama May 4, 2017
a8d5430
Remove exception messages since they never appear
yujinakayama May 4, 2017
383eee6
Handle a bug in Proc#source_location of JRuby 1.7
yujinakayama May 4, 2017
87aebff
Merge pull request #990 from rspec/fix-error-raised-with-proc-without…
yujinakayama May 4, 2017
8f9993b
Updates changelog for v3.6.0 [ci skip]
May 4, 2017
ede3472
Releases 3.6.0
May 4, 2017
8516bdc
Bump version to 3.7.0.pre
May 5, 2017
955d603
Fix `Should.md` headings.
myronmarston Jun 21, 2017
8c1e0e4
Updates for frozen-string-literal compatibility. (#997)
pat Jun 28, 2017
5c4ca95
Update changelog.
myronmarston Jun 29, 2017
b1c83b7
Use clearer variable names in documentation (features). (#1000)
jkingdon Jul 14, 2017
1c9d5d9
Updated travis build scripts (from rspec-dev) (#1003)
myronmarston Jul 16, 2017
da6ae06
Add receiver info to ChangeDetails#value_representation
joker1007 Jul 25, 2017
ff1991c
Support Module, nil, and objects that don't respond to `#class`
joker1007 Jul 27, 2017
7e3d9bd
Add surrounding backquote to result of `#inspect_message_with_receiver`
joker1007 Jul 27, 2017
80b2721
Fix matchers/built_in/change_spec
joker1007 Jul 27, 2017
6144af1
Updated travis build scripts (from rspec-dev)
yujinakayama Aug 9, 2017
d7c74ef
Merge pull request #1007 from rspec/update-travis-build-scripts-2017-…
yujinakayama Aug 10, 2017
dc1cc2f
Updated travis build scripts (from rspec-dev)
yujinakayama Sep 15, 2017
430cf59
Merge pull request #1014 from rspec/update-travis-build-scripts-2017-…
yujinakayama Sep 15, 2017
4f61181
Ensure alias matchers are included in our docs. (#1016)
myronmarston Sep 22, 2017
cf8e9d6
Updates changelog for v3.7.0 [ci skip]
Oct 17, 2017
4052985
Releases 3.7.0
Oct 17, 2017
d1116cb
Bump version to 3.8.pre
Oct 17, 2017
e212d87
Updated travis build scripts (from rspec-dev)
kachick Nov 3, 2017
c19b2cc
Merge pull request #1021 from kachick/update-travis-build-scripts-201…
JonRowe Nov 3, 2017
7ef82ba
Updated travis build scripts (from rspec-dev)
JonRowe Nov 13, 2017
1461c96
Merge pull request #1023 from rspec/update-travis-build-scripts-2017-…
JonRowe Nov 13, 2017
c4a8495
Updated travis build scripts (from rspec-dev)
JonRowe Nov 21, 2017
5242697
Merge pull request #1026 from rspec/update-travis-build-scripts-2017-…
JonRowe Nov 21, 2017
160590d
Test fix for hash ordering for PR https://github.com/rspec/rspec-supp…
jcrisp Nov 24, 2017
b47fa00
Merge pull request #1027 from jcrisp/master
JonRowe Nov 30, 2017
86c4153
Use Support.class_of to generate message notation
yujinakayama Dec 28, 2017
236d8c6
Merge pull request #1005 from joker1007/improve-change-matcher-failur…
yujinakayama Dec 28, 2017
8ca62f8
Follow-up to #1005
yujinakayama Dec 28, 2017
85b1fbf
Add changelog entry for #1005
yujinakayama Dec 28, 2017
eafc87f
Merge pull request #1032 from rspec/follow-up-1005
yujinakayama Dec 28, 2017
37b10fb
Disable Ruby 2.5 feature to avoid test failures on 2.5. (#1037)
myronmarston Dec 31, 2017
a98c493
Updated travis build scripts (from rspec-dev) (#1041)
myronmarston Jan 3, 2018
43c557d
Use `hash` for `change` matcher to handle deeply nested objects.
myronmarston Dec 29, 2017
dc4a49b
Correctly detect both a mutation and replacement from `change`.
myronmarston Dec 30, 2017
c8c1818
Merge pull request #1034 from rspec/myron/1030-fix-change-matcher
myronmarston Jan 3, 2018
a85a42c
Update yard to 0.9.12, motivated by CVE.
xaviershay Dec 31, 2017
fcc2aa3
Prevent method from being counted as undoc'ed
xaviershay Jan 9, 2018
5293ded
Merge pull request #1038 from rspec/upgrade-yard
xaviershay Jan 10, 2018
dc60dbe
Upgrade rubocop, motivated by CVE.
xaviershay Dec 31, 2017
267ecec
Unset RUBYOPT before rubocop'ing to allow gems to be used
xaviershay Jan 5, 2018
a0c3958
Duck-typing support for the `include` matcher (#1012)
pablobm Jan 10, 2018
fffbfda
Changelog for #1012.
myronmarston Jan 10, 2018
bee4e14
Merge pull request #1040 from rspec/upgrade-rubocop
JonRowe Jan 10, 2018
a81b067
Use https:// instead of git:// URLs in READMEs (#1044)
alyssais Feb 15, 2018
1aad4d7
Updated travis build scripts (from rspec-dev)
benoittgt Mar 4, 2018
5f8aad1
Merge pull request #1050 from benoittgt/update-travis-build-scripts-2…
JonRowe Mar 4, 2018
a876039
Pin ffi on RBX
JonRowe Mar 18, 2018
250631c
Merge pull request #1052 from rspec/support_ffi_on_rbx
JonRowe Mar 19, 2018
cb87930
Updated travis build scripts (from rspec-dev)
JonRowe Apr 5, 2018
f4e95d4
Merge pull request #1054 from rspec/update-travis-build-scripts-2018-…
JonRowe Apr 5, 2018
b1347ec
Updated common markdown files (from rspec-dev) [ci skip]
benoittgt Apr 17, 2018
a4f2547
Merge pull request #1055 from benoittgt/update-common-markdown-files-…
JonRowe Apr 18, 2018
7220c35
Avoid leaking max_formatted_output_length change
benoittgt Apr 25, 2018
8e0ba25
Change rdoc: the first word needs to match the variable
benoittgt Apr 25, 2018
3e5fc98
Merge pull request #1056 from benoittgt/samphippen/make-object-format…
JonRowe Apr 25, 2018
9989d87
Changelog for #951, #1056
JonRowe Apr 25, 2018
20788e1
Add doc to inform that max_formatted_output_length can be set to nil …
benoittgt Apr 25, 2018
848fcb4
Update Should.md to suggest is_expected in one-liners (#1061)
adimasuhid Jun 6, 2018
ee52e31
Refine ExpectationNotMetError message
Jul 6, 2018
2930174
Merge pull request #1066 from nicktime/refine-expectationnotmeterror-…
JonRowe Jul 6, 2018
a132fa4
Change log for #1066
JonRowe Jul 6, 2018
0be12e3
Update changelog for 3.8 release.
myronmarston Aug 4, 2018
181a86e
Release 3.8.0.
myronmarston Aug 4, 2018
76ed5cf
Bump version to 3.9.0.pre.
myronmarston Aug 4, 2018
3a0b5e4
call to_hash only when object is not a Hash in RSpec::Matcher::BuiltI…
eitoball Aug 6, 2018
31f108e
Forwardport 3.8.1 release notes.
myronmarston Aug 7, 2018
2c19f38
Support checking initialize when checking respond_to(:new)
JonRowe Sep 13, 2018
e20fcac
Merge pull request #1072 from rspec/respond_to_checks_initialize_for_new
JonRowe Sep 18, 2018
8947285
Update changelog for #1072
JonRowe Sep 18, 2018
06fca6b
Updated travis build scripts (from rspec-dev)
JonRowe Sep 19, 2018
81b6039
Prevent Github vulnerability warning
JonRowe Sep 19, 2018
4e8af84
Merge pull request #1073 from jkowens/3-8-maintenance
JonRowe Sep 20, 2018
66a9fa4
Changelog for #1073
JonRowe Sep 20, 2018
5c37bd9
Merge pull request #1077 from rspec/update_ffi
JonRowe Sep 20, 2018
7751bc5
Handle unexpected KeyError / IndexError
JonRowe Sep 19, 2018
005757e
Merge pull request #1076 from rspec/prevent_unexpected_index_error
JonRowe Sep 20, 2018
68b89c1
Changelog for #1076
JonRowe Sep 20, 2018
88c4382
Merge pull request #1075 from rspec/update-travis-build-scripts-2018-…
JonRowe Sep 21, 2018
0025231
Merge 3-8-maintenance
JonRowe Oct 9, 2018
c5cebd7
Add project metadata to the gemspec
orien Oct 19, 2018
5229572
Merge pull request #1081 from orien/project-metadata
JonRowe Oct 19, 2018
3b6b9eb
Replace "should" with "is expected to" in Generated Descriptions (#1080)
johnsyweb Oct 31, 2018
7b98d0c
Changelog for #1080
JonRowe Oct 31, 2018
ea41bcd
Update terminology in BUILD_DETAIL.md (#1083)
JuanitoFatas Nov 14, 2018
fa47f4a
Updated travis build scripts (from rspec-dev)
benoittgt Nov 17, 2018
fd3ccee
Merge pull request #1085 from benoittgt/update-travis-build-scripts-2…
benoittgt Nov 17, 2018
2089a1e
Fix nested `all` repeated failure message (#1086)
english Nov 23, 2018
499d7f3
Changelog for #1086
JonRowe Nov 23, 2018
c04c21f
Fix ws issues
JonRowe Nov 23, 2018
dc0ecfd
Add chained matchers example to raise_error (#1087)
JackWink Nov 28, 2018
3d98ae7
Updated travis build scripts (from rspec-dev) (#1091)
JonRowe Dec 21, 2018
3471b7c
Improve documentation surrounding array matchers (#1090)
JonRowe Dec 30, 2018
6a17d8a
Updated travis build scripts (from rspec-dev) (#1092)
JonRowe Dec 30, 2018
861355e
Updated travis build scripts (from rspec-dev) (#1093)
JonRowe Jan 1, 2019
965be98
Updated travis build scripts (from rspec-dev) (#1094)
JonRowe Jan 4, 2019
1859032
Updated travis build scripts (from rspec-dev) (#1095)
JonRowe Jan 8, 2019
11afda9
Pin gem versions on older JRuby and windows (#1098)
JonRowe Feb 2, 2019
cea8727
Cleanup after fixing JRuby (#1099)
JonRowe Feb 4, 2019
9b91877
Handle subject hash change after change matcher has run (#1100)
pirj Feb 8, 2019
03af89d
Changelog for #1100
JonRowe Feb 8, 2019
79f66d0
Updated travis build scripts (from rspec-dev) (#1109)
olleolleolle Apr 1, 2019
2d34748
Added warning message for BasicObject with unsupported matchers (#1107)
taichi-ishitani Apr 3, 2019
8d630d1
Changelog for #1107
JonRowe Apr 3, 2019
49fcbee
Updated travis build scripts (from rspec-dev) (#1110)
olleolleolle Apr 18, 2019
7a5c9f7
Bump to 3.8.3
JonRowe Apr 20, 2019
856b8ab
"KindOf" matchers: Rescue `NoMethodError` instead of `respond_to?` ch…
flvrone May 3, 2019
12bca28
Changelog for #1112
JonRowe May 3, 2019
1044d4e
Deal with new ffi Ruby version requirement (#1115)
benoittgt May 20, 2019
23c11fc
Fix RuboCop offences (#1104)
pirj Jun 9, 2019
721be32
Changelog for 3.8.4
JonRowe Jun 10, 2019
b1d15ac
Update Aruba to version 0.14.10 (#1118)
mvz Jun 21, 2019
45e5070
Add Expectations namespace to ExpectationTarget tags. (#1121)
castwide Jun 25, 2019
51ba183
Updated travis build scripts (from rspec-dev) (#1122)
JonRowe Jul 8, 2019
75f5cc9
Updated travis build scripts (from rspec-dev) (#1123)
benoittgt Jul 24, 2019
5e0cf19
Add support for not swallowing expectation errors when matching negat…
JonRowe Sep 3, 2019
443212a
Improve `change` mather detection of objects that have changed. (#1132)
JonRowe Sep 10, 2019
0a77e20
Change log for #1132
JonRowe Sep 10, 2019
771da6d
Prevent block-only matchers from being used with value expectation ta…
pirj Jul 26, 2019
110243e
Merge pull request #1125 from pirj/prevent-block-matchers-from-being-…
pirj Sep 14, 2019
4310cb9
Wrap up bug fixes
JonRowe Sep 17, 2019
b37f5ab
Notice when object implement inspect but == is different (#1126)
benoittgt Sep 20, 2019
2f0cbb2
Change log for #1126
JonRowe Sep 20, 2019
fc0bcb5
Pin minitest on older Rubies (#1133)
JonRowe Sep 25, 2019
623a8f3
Merge remote-tracking branch 'rspec-expectations/master' into merge-r…
p8 Oct 2, 2019
32630ab
Handle merge conflicts
p8 Oct 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
.rvmrc
*.sw?
.DS_Store
Expand All @@ -7,16 +8,32 @@ rdoc
pkg
tmp
tags
=======
*.sw?
.DS_Store
coverage*
rdoc
pkg
doc
tmp
>>>>>>> rspec-expectations/master
rerun.txt
Gemfile.lock
.bundle
*.rbc
<<<<<<< HEAD
bin
.rbx
.yardoc
vendor
Gemfile-custom
.idea
=======
.yardoc
bin
.rbx
Gemfile-custom
>>>>>>> rspec-expectations/master
bundle
.rspec-local
spec/examples.txt
Expand Down
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<<<<<<< HEAD
--order rand
=======
>>>>>>> rspec-expectations/master
--warnings
--require spec_helper
131 changes: 131 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ inherit_from:
- .rubocop_rspec_base.yml

AllCops:
<<<<<<< HEAD
Exclude:
# This code was taken from the backports gem. We don't want to mess with it.
- lib/rspec/core/backport_random.rb
Expand Down Expand Up @@ -108,3 +109,133 @@ Performance/Caller:

Metrics/BlockLength:
Max: 193
=======
TargetRubyVersion: 2.1
DisplayCopNames: true
Exclude:
- bin/*
- tmp/**/*

# Over time we'd like to get this down, but this is what we're at now.
LineLength:
Max: 186

# Offense count: 1
Style/BlockComments:
Enabled: false

Style/BracesAroundHashParameters:
Exclude:
- spec/**/*

Style/ClassAndModuleChildren:
Exclude:
- spec/**/*

Style/EvalWithLocation:
Exclude:
- spec/rspec/matchers/built_in/respond_to_spec.rb

Style/MultilineBlockChain:
Exclude:
- spec/**/*

Style/RescueModifier:
Exclude:
- spec/**/*
- benchmarks/**/*

Style/Semicolon:
Enabled: false

Style/SingleLineMethods:
Exclude:
- spec/**/*
- benchmarks/**/*

# We have some situations where we need to use `raise ExceptionClass.new(argument)`.
Style/RaiseArgs:
Enabled: false

Style/FrozenStringLiteralComment:
EnforcedStyle: never
Exclude:
- REPORT_TEMPLATE.md

Style/PercentLiteralDelimiters:
PreferredDelimiters:
default: []
'%r': '||'

Style/WordArray:
Enabled: false

Security/Eval:
Exclude:
- Gemfile

Metrics/AbcSize:
Max: 26

# Offense count: 2
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 96
Exclude:
- spec/**/*

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 239
Exclude:
- spec/**/*

# Offense count: 4
Metrics/PerceivedComplexity:
Max: 14

AccessModifierIndentation:
Exclude:
- 'lib/rspec/expectations/syntax.rb' # Too much diff to fix

# Offense count: 7
Layout/AlignParameters:
Enabled: false

Layout/SpaceInsideArrayLiteralBrackets:
Exclude:
- spec/rspec/matchers/built_in/contain_exactly_spec.rb

Layout/SpaceInsideParens:
Exclude:
- spec/rspec/matchers/built_in/*

Lint/AmbiguousBlockAssociation:
Exclude:
- spec/**/*

Lint/AmbiguousRegexpLiteral:
Exclude:
- 'features/step_definitions/*'

Lint/HandleExceptions:
Exclude:
- benchmarks/**/*

# Offense count: 3
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/rspec/matchers.rb'
- 'lib/rspec/matchers/built_in/compound.rb'

Lint/InheritException:
Exclude:
- 'lib/rspec/expectations.rb'

Bundler/DuplicatedGem:
Enabled: false

Bundler/OrderedGems:
Enabled: false
>>>>>>> rspec-expectations/master
4 changes: 4 additions & 0 deletions .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
# This file was generated on 2019-07-24T15:33:48+02:00 from the rspec-dev repo.
=======
# This file was generated on 2019-07-24T15:33:50+02:00 from the rspec-dev repo.
>>>>>>> rspec-expectations/master
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# This file contains defaults for RSpec projects. Individual projects
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
# This file was generated on 2019-07-24T15:33:48+02:00 from the rspec-dev repo.
=======
# This file was generated on 2019-07-24T15:33:50+02:00 from the rspec-dev repo.
>>>>>>> rspec-expectations/master
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# In order to install old Rubies, we need to use old Ubuntu distibution.
Expand Down
4 changes: 4 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
--exclude features
--no-private
--markup markdown
<<<<<<< HEAD
--default-return void
-
Filtering.md
=======
-
>>>>>>> rspec-expectations/master
Changelog.md
LICENSE.md
176 changes: 176 additions & 0 deletions Should.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# `should` and `should_not` syntax

From the beginning RSpec::Expectations provided `should` and `should_not` methods
to define expectations on any object. In version 2.11 `expect` method was
introduced which is now the recommended way to define expectations on an object.

### Why switch over from `should` to `expect`

#### Fix edge case issues

`should` and `should_not` work by being added to every object. However, RSpec
does not own every object and cannot ensure they work consistently on every object.
In particular, they can lead to surprising failures when used with BasicObject-subclassed
proxy objects.

`expect` avoids these problems altogether by not needing to be available on all objects.

#### Unification of block and value syntaxes

Before version 2.11 `expect` was just a more readable alternative for block
expectations. Since version 2.11 `expect` can be used for both block and value
expectations.

```ruby
expect(actual).to eq(expected)
expect { ... }.to raise_error(ErrorClass)
```

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)
For a detailed explanation

### One-liners

The one-liner syntax supported by
[rspec-core](http://rubydoc.info/gems/rspec-core) uses `should` even when
`config.syntax = :expect`. It reads better than the alternative, and does not
require a global monkey patch:

```ruby
describe User do
it { should validate_presence_of :email }
end
```

It can also be expressed with the `is_expected` syntax:

```ruby
describe User do
it { is_expected.to validate_presence_of :email }
end
```

### Using either `expect` or `should` or both

By default, both `expect` and `should` syntaxes are available. In the future,
the default may be changed to only enable the `expect` syntax.

If you want your project to only use any one of these syntaxes, you can configure
it:

```ruby
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect # disables `should`
# or
c.syntax = :should # disables `expect`
# or
c.syntax = [:should, :expect] # default, enables both `should` and `expect`
end
end
```

See
[RSpec::Expectations::Syntax#expect](http://rubydoc.info/gems/rspec-expectations/RSpec/Expectations/Syntax:expect)
for more information.

## Usage

The `should` and `should_not` methods can be used to define expectations on any
object.

```ruby
actual.should eq expected
actual.should be > 3
[1, 2, 3].should_not include 4
```

## Using Built-in matchers

### Equivalence

```ruby
actual.should eq(expected) # passes if actual == expected
actual.should == expected # passes if actual == expected
actual.should_not eql(expected) # passes if actual.eql?(expected)
```

Note: we recommend the `eq` matcher over `==` to avoid Ruby's "== in a
useless context" warning when the `==` matcher is used anywhere but the
last statement of an example.

### Identity

```ruby
actual.should be(expected) # passes if actual.equal?(expected)
actual.should_not equal(expected) # passes if actual.equal?(expected)
```

### Comparisons

```ruby
actual.should be > expected
actual.should be >= expected
actual.should be <= expected
actual.should be < expected
actual.should be_within(delta).of(expected)
```

### Regular expressions

```ruby
actual.should match(/expression/)
actual.should =~ /expression/
```

### Types/classes

```ruby
actual.should be_an_instance_of(expected)
actual.should_not be_a_kind_of(expected)
```

### Truthiness

```ruby
actual.should be_true # passes if actual is truthy (not nil or false)
actual.should be_false # passes if actual is falsy (nil or false)
actual.should be_nil # passes if actual is nil
```

### Predicate matchers

```ruby
actual.should be_xxx # passes if actual.xxx?
actual.should_not have_xxx(:arg) # passes if actual.has_xxx?(:arg)
```

### Ranges (Ruby >= 1.9 only)

```ruby
(1..10).should cover(3)
```

### Collection membership

```ruby
actual.should include(expected)
actual.should start_with(expected)
actual.should end_with(expected)
```

#### Examples

```ruby
[1,2,3].should include(1)
[1,2,3].should include(1, 2)
[1,2,3].should start_with(1)
[1,2,3].should start_with(1,2)
[1,2,3].should end_with(3)
[1,2,3].should end_with(2,3)
{:a => 'b'}.should include(:a => 'b')
"this string".should include("is str")
"this string".should start_with("this")
"this string".should end_with("ring")
```
Loading