Jasmine:扫描别名时没有找到预期的字母或数字字符

时间:2012-10-19 21:13:01

标签: javascript ruby jasmine

在浏览http://testfirst.org/learn_javascript时,我尝试在00_hello /文件夹中运行rake jasmine。我收到这个错误:

hugos-MacBook-Pro:00_hello hugo$ rake jasmine --trace
(in /Users/hugo/Developer/test_first_javascript/learn_javascript)
** Invoke jasmine (first_time)
** Invoke jasmine:server (first_time)
** Invoke jasmine:require (first_time)
** Execute jasmine:require
** Execute jasmine:server
your tests are here:
  http://localhost:8888/
rake aborted!
(<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 5 column 7
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in `parse'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:127:in `load'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/config.rb:19:in `simple_config'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/config.rb:62:in `spec_dir'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/runner_config.rb:32:in `spec_dir'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/application.rb:28:in `block (2 levels) in app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `new'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `block in generate_map'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `generate_map'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:128:in `to_app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:55:in `app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/application.rb:14:in `app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/server.rb:3:in `initialize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/tasks/jasmine.rake:51:in `new'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/tasks/jasmine.rake:51:in `block (2 levels) in <top (required)>'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `load'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `<main>'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => jasmine => jasmine:server

我做了一些调查并发现了这个:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680227。可能是我的ruby解析器错了/我使用的是错误版本的ruby。

hugos-MacBook-Pro:00_hello hugo$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]

思想?

1 个答案:

答案 0 :(得分:22)

好像你有一些不起作用的角色。看看你的spec / support / jasmine.yaml,你可能会有类似的东西:

- **/*.js

只需将其替换为:

- '**/*.js'