Skip to content

Replace bacon with rspec#41

Merged
iliabylich merged 2 commits intowhitequark:masterfrom
nc7s:replace-bacon
Mar 19, 2025
Merged

Replace bacon with rspec#41
iliabylich merged 2 commits intowhitequark:masterfrom
nc7s:replace-bacon

Conversation

@nc7s
Copy link
Contributor

@nc7s nc7s commented Mar 19, 2025

bacon saw its last code change in 2017, and an official announcement that development "halted". This replaces it with the actively maintained RSpec.

The motivation is Canop/bacon#342, ruby-ast is one of two packages still actively using bacon (the Ruby one).

The meat is migrating from the old value.should.be/equal/etc. expected syntax to the new expect(value).to/to_not eq/be/etc. expected one. s() is somehow prohibited to run in it blocks, so context blocks are introduced to store them. The have_sexp thing which is basically value.should lambda seems to have no equivalent in current RSpec, so I modified it a little to be expect(lambda(<<-EOF).call(value)).to be true.

All tests (now specs?) still pass.

RSpec has built-in color support, supposedly equivalent to bacon-colored_output.

I'm sorry the directory move from test/ to spec/ caused a full deletion and a long addition. In my Debian patch an option is added to the Rakefile block so it still uses the test/ directory, reducing patch size. If you'd like this to be that way, let me know.

@iliabylich iliabylich merged commit 0fc24ef into whitequark:master Mar 19, 2025
9 of 10 checks passed
@iliabylich
Copy link
Collaborator

LGTM, thanks! We can ignore JRuby failure, I'll update the matrix myself.

Do you need a release?

@nc7s
Copy link
Contributor Author

nc7s commented Mar 19, 2025

Wow, so fast, thanks!

No need to break out of your usual schedule, we can carry the patch for now ;)

@iliabylich
Copy link
Collaborator

@nc7s 2.4.3 has been released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants