presidentbeef/rubygems — comment on commit 2838ee7119bfcf3aadae940e2c6ee7e5d472895d
File: test/rubygems/test_gem_commands_install_command.rb line 464
By zenspider:

Hey! I've had two espressos now so my brain is (sorta) working!

The prefix and suffix of those two tests are identical, the only thing that changes is the middle bits where the files are being prepared. So I propose refactoring the whole thing into something like:

assert_server do
# write files
end

so the tests would be

test_thingy_positive
assert_server expected_message do
# write out 3 files
end
end

test_thingy_negative
assert_server expected_message do
# write out 1 file
end
end

... or something like that