I have a piece of code that I am trying to run with rspec.
require 'spec_helper'
describe "User" do
before { @user = User.new(name: "Example User", email: "user@example.com", password: "foobar", password_confirmation: "foobar") }
subject { @user }
it { should respond_to(:name)}
end
I get the following error
c:\Sites\sample_app>rspec spec/models/user_spec.rb
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-2.13.1/lib/rspec
/core/configuration.rb:819:in `load': c:/Sites/sample_app/spec/models/user_spec.
rb:1: syntax error, unexpected tIDENTIFIER, expecting end-of-input (SyntaxError)
before { @user...er'
Now I retype the test in a new file and run that and no error. I guess there is some encoding issue or something that I just have not learnt about that I am not getting. Is there anyone that could shed some light on this issue?