Setting version to an empty string in tests

Check for nil and length on version in package/rubygems tests

In gemspec test change @new_resource.instance_variable_set()
to @new_resource.version()

 Based on #2446

New PR opened due to..git issues.