rspec을 사용하여 실행하려고하는 코드가 있습니다.레일 4 - 구문 오류, 예상치 못한 tIDENTIFIER, end-of-input을 예상 함
require 'spec_helper'
describe "User" do
before { @user = User.new(name: "Example User", email: "[email protected]", password: "foobar", password_confirmation: "foobar") }
subject { @user }
it { should respond_to(:name)}
end
나는 지금은 새 파일에 테스트를 다시 입력하고 및 오류없이 실행 다음과 같은 오류
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'
를 얻을. 나는 내가 얻지 못하고 있다는 것을 알지 못했던 인코딩 문제 나 뭔가가있는 것 같아요. 이 문제에 대해 밝힐 수있는 사람이 있습니까?
spec_helper가 필요한 라인 1에서 오류가 발생하므로 spec_helper 코드를 공유 할 수 있습니까? –
예 "user_spec.rb : 1"오류가 표시됨 ...이 질문을 잘못 작성 했습니까? 이상하게도 이미 -1이 있습니다. 그냥 약간의 도움을 찾고 :/ –
@SachinSingh에서 코멘트를 다시 읽어주세요 :-) 당신이'spec_helper.rb' 파일을 게시하라는 메시지가 나타납니다. 문제의 원인이 될 가능성이 높습니다. –