Continuing with the Video store refactoring from the book…

Moving amountFor:

After the success of extracting amountFor: I opted to use the refactoring browser’s “Move to another class” functionality to move the method across to Rental.

Refactoring menu

After choosing the destination class…

Choose destination

I ended up with amountFor: on the Rental class.

Browsing method

Migrated method

Unfortunately, this broke my tests:

Broken tests

The Pharo traceback was fairly clear:

Broken tests

But, by clicking on the Create button I got to fix it fairly easily.

Broken tests

And adding an interim method to keep my tests passing:

Broken tests