Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug #19259] Data#with should call initialize method #7031

Merged
merged 1 commit into from Feb 14, 2023

Conversation

nobu
Copy link
Member

@nobu nobu commented Dec 26, 2022

No description provided.

@@ -215,6 +215,20 @@ def test_with
assert_raise_with_message(ArgumentError, "wrong number of arguments (given 1, expected 0)") do
source.with({ bar: 2 })
end

oddclass = Data.define(:odd) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a structuring comment like "Testing #initialize is called" or something? The rest of the method has brief structuring, and I believe it is helpful for maintainers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather I'd prefer splitting this test method per the comments later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or this 🤷
(Honestly, I miss RSpec's nesting. It might become unhinged sometimes, but at least describe '#initialize with nested examples and contexts really helps with reading and running tests.)

@matzbot matzbot merged commit 45f0e3a into ruby:master Feb 14, 2023
@nobu nobu deleted the data_with-call-initialize branch February 14, 2023 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants