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

add ruby 2.7...3.0 specs for Object#{taint,untaint,trust,untrust} #802

Merged
merged 2 commits into from
Oct 20, 2020

Conversation

HeroProtagonist
Copy link
Contributor

@HeroProtagonist HeroProtagonist commented Oct 20, 2020

relates to #745
Closes checkbox for Object#{taint,untaint,trust,untrust}

@HeroProtagonist HeroProtagonist changed the title add specs for Object#{taint,untaint,trust,untrust} add ruby 2.7...3.0 specs for Object#{taint,untaint,trust,untrust} Oct 20, 2020
obj.taint
}.should complain(/Object#taint is deprecated and will be removed in Ruby 3.2/)
end
end
Copy link
Member

Choose a reason for hiding this comment

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

I believe $VERBOSE should be rolled back to default value to not affect other specs. AFAIK it isn't done by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed all spots to use complain("...", verbose: true). I think that would address this.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, complain() will restore it properly.
BTW I recently added a check that $VERBOSE isn't changed by a spec example in MSpec, just not merged upstream yet.

o = Object.new.untrust
o.trust
o.should_not.untrusted?
end
Copy link
Member

Choose a reason for hiding this comment

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

Not sure whether I understand what this case checks.

It might check that trust method doesn't change object state. But o.should_not.untrusted? assertion checks that untrusted? returns false. Wouldn't it be expected behavior if trust worked and changed an object state?

Copy link
Contributor Author

@HeroProtagonist HeroProtagonist Oct 20, 2020

Choose a reason for hiding this comment

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

Put an o.should_not.untrusted? above the o.trust to show nothing happens

@andrykonchin
Copy link
Member

Thank you for the specs

@andrykonchin andrykonchin merged commit 785eccd into ruby:master Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants