0
는 오류 메시지가 매우 이상하다 : 내가 "최종 제거하는 것이 요청된다했어야 컨텍스트와 구문, 루비 2.1
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:10:in `require':
/Users/jayunit100/Development/leitmotif/test/test_leitmotif.rb:21:
syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
끝 "성명서를 작성하고, 그렇게하면 실제로 컴파일됩니다! 그래서 내 첫 질문은, 어떻게 또는 왜 rake_test_loader가 닫는 끝 블록없이 클래스 선언을 원한다는 것입니다. 여기
require 'helper'
require 'minitest/autorun'
class TestLeitmotif < MiniTest::Test
### A simple test
context "Leitmotif core tests" do
setup do
@lm = Leitmotif.new
end
should "run should return 1 if arguments are invalid"
@lm=Leitmotif.new
print("\nASDF\n")
print(@lz.inspect);
print(@lm.inspect)
print("\nASDF\n")
[email protected]("","")
#assert_equal 1, x
end
end
end
내 두 번째 문제는 설정 블록에서 선언 된 변수
@lm = Leimotif.new
에서, 해야 방법에 접근 할 수없는 것으로 보인다는 것이다.
내 생각에 의심스러운 부분은 should 프레임 워크의 구문이 현재 버전의 ruby에서 올바르게 구문 분석되지 않지만 루비에 새로운 것이므로 어떠한 통찰력도 인정 될 것입니다.
감사합니다.
이것은 Ruby의 블록 구문을 오타 또는 오해 한 것입니다. 'end' 작업을 제거하는 이유는 클래스 레벨에서'should' 블록에 있어야했던 모든 것을하기 때문입니다. –