我试图让Jasmine在命令行中运行(无头),但没有成功。使用我们当前的配置:
的Gemfile:
gem 'jasmine', :git => "git://github.com/pivotal/jasmine-gem.git"
gem 'jasmine-headless-webkit', :git => "git://github.com/johnbintz/jasmine-headless-webkit.git"
我目前的茉莉花规格配置在浏览器中运行。但是,rake jasmine:ci
会打开一个浏览器,然后很快就会中止此错误消息:
/Users/`<me>`/.rvm/gems/ruby-2.0.0-p353/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable': unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)
我查看了jasmine-headless-webkit的github页面,看到该项目被列为死亡。所以!我试图取代茉莉花和茉莉花带有jasmine-rails
的jasmine-headless-webkit gem,我收到了这个错误:
ERROR: TypeError: 'undefined' is not an object (evaluating 'jasmine.Matchers.prototype')
TRACE:
-> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 711
-> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 736
-> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 738
-> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 862
rake aborted!
Error executing command: "/Users/<me>/.phantomjs/1.9.7/darwin/bin/phantomjs" "/Users/<me>/.rvm/gems/ruby-2.0.0-p353/gems/jasmine-rails-0.9.0/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/Users/<me>/<myapp>/tmp/jasmine/runner.html?spec="
答案 0 :(得分:1)
由于大多数用户似乎都希望使用幻像来运行他们的jasmine规范,因此作为2.0版本的一部分,我们将其设为默认值。使用硒运行jasmine:ci
的能力被提取到its own gem。