rspecを初めて使ったので、モックを使うメモ gemのmailを使ってGmailを送るメソッドがある。 require "mail" # ... def send_alert_to_gmail(content) mail = Mail.new mail.from = CONFIG['email'] mail.to = CONFIG['to'] mail.charset = "UTF8" mail.body = content mail.delivery_method :smtp, { :address => 'smtp.gmail.com', :port => 587, :domain => 'smtp.gmail.com', :user_name => CONFIG['email'], :password => CONFIG['password'], :authentication =