Fix unit tests and deprecation warnings.

This pull request fixes some deprecation warnings and tests, it also replace the old Gem::Builder.new(spec).build by Gem::Package.build(spec).