I have some rspec tests in RubyMine, they works perfect, when I run them from RubyMine interface.
But when I try to run same test from terminal, they fail.
I use ruby-gmail gem to send mail trougth gmail using this construction:
@gmail.deliver do
to current_unread_mail.reply_to
subject "Re: " + current_unread_mail.title
body reply_body
end
It’s successfully send mail if I run from RubyMine, but didn’t send mail (but not raising any kind of exception) when I run my rspec like this
rspec test_spec.rb
So I think the reason for this, that RubyMine add some additional rspec parameters, when it runs.
First line in Rspec output in RubyMine is something like this:
/home/user/.rvm/rubies/ruby-1.9.2-p318/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/user/.rvm/gems/ruby-1.9.2-p318@global/bin/rspec /home/user/path_to_spec/test_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter
But If I run this code from terminal I got error
bash: syntax error near unexpected token `$0=ARGV.shift'
What can I do?
Found a problem.
I used a Ruby-Gmail gem, but when I switched for Gmail gem (fork of Ruby-Gmail) and changes syntax to
It works fine for me.