Project

General

Profile

Bug #34064

ParameterFilterTest accidentally modifies Mocha::Mock

Added by Evgeni Golov about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

$ bundle exec rake test TEST=test/unit/parameter_filter_test.rb TESTOPTS=-v
#<Mocha::Mock:0x0000557bf12cf750>#test_0002_permits plugin-added attributes from blocks = 0.49 s = .
#<Mocha::Mock:0x0000557bf1f22e30>#test_0001_permits plugin-added attribute = 0.04 s = .

Associated revisions

Revision 104493b2 (diff)
Added by Evgeni Golov about 1 year ago

Fixes #34064 - don't override magic `klass` variable

when you let(:klass), it somehow touches the `Mocha::Mock` class,
instead of creating a new thing, freaking out Mocha in the process.

before:

$ bundle exec rake test TEST=test/unit/parameter_filter_test.rb TESTOPTS=-v
#&lt;Mocha::Mock:0x0000557bf12cf750&gt;#test_0002_permits plugin-added attributes from blocks = 0.49 s = .
#&lt;Mocha::Mock:0x0000557bf1f22e30&gt;#test_0001_permits plugin-added attribute = 0.04 s = .

after:

$ bundle exec rake test TEST=test/unit/parameter_filter_test.rb TESTOPTS=-v
ParameterFilterTest::with nested object#test_0001_constructs permit() args for nested attribute through second filter 0.52 = .
ParameterFilterTest::with nested object#test_0002_permits nested attribute through second filter 0.04 = .

History

#1 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8963 added

#2 Updated by The Foreman Bot about 1 year ago

  • Fixed in Releases 3.2.0 added

#3 Updated by Evgeni Golov about 1 year ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF