A cleaner way to write this is to use the `||=` operator, however, I would go a step further.  We shouldn't call credentials_from_file at all, if the class variables are already set.  This way, you can clean up your specs as well to avoid creating the temp cred file.  So this could all be simplified to 

```ruby
  def self.credentials
    if username.nil? || password.nil?
      un_from_file, pw_from_file = self.credentials_from_file
      self.username ||= un_from_file
      self.password ||= pw_from_file
    end
    ...