TypeError:没有从nil到整数的隐式转换

时间:2015-07-08 17:02:55

标签: ruby-on-rails ruby windows

我正在使用Ruby和IEDriverServer.exe在Windows上运行一些自动化测试。当我运行rake users_creation命令时出现此错误,我不知道这意味着什么:

C:\Users\SolaresIntern\Desktop\Developer\Quality-Assurance>rake users_creation
C:/Ruby22-x64/bin/ruby -S bundle exec cucumber --require features features/users
_creation/*.feature --profile html_report
rake aborted!
TypeError: no implicit conversion from nil to integer
C:/Users/SolaresIntern/Desktop/Developer/Quality-Assurance/Rakefile:25:in `block
 (2 levels) in <top (required)>'
Tasks: TOP => users_creation
(See full trace by running task with --trace)

这让我看到了Rakefile,这就是那里的内容:

require 'cucumber/rake/task' require 'resque/tasks' require 'resque'

require_relative 'lib/queue/start_script'

SPEC_SUITES = [
  { id: 'everything', title: 'All the testcases', features: "features/**/*.feature", done: false },
  { id: 'class_creation', title: 'Teacher adds a class', features: "features/class_managing/*.feature", done: false },
  { id: 'users_creation', title: 'Sign up students and teachers', features: "features/users_creation/*.feature", done: false },
  { id: 'join_a_class', title: 'Student joins a class', features: "features/students_dashboard/join_a_class.feature", done: false },
  { id: 'create_assignment', title: 'Create an assignment', features: "features/lessons_assignments/*.feature", done: false},
  { id: 'join_class_with_assignment', title: 'Student joins a class with assignments', features: "features/students_dashboard/join_a_class_with_assignments.feature", done: false}
]

SPEC_SUITES.each do |suite|
  desc "Ejecuta todos los specs en la suite #{suite[:title]}"
# task "#{suite[:id]}", [:entorno, :browser] do |t, args|
  task "#{suite[:id]}" do |t|
#   args.with_defaults(:entorno => ENV['ENTORNO'], :browser => ENV['BROWSER'])
#   ENV['ENTORNO']=args.entorno.downcase
#   ENV['BROWSER']=args.browser
    Rake::Task["#{suite[:id]}:run"].execute
  end

  Cucumber::Rake::Task.new("#{suite[:id]}:run") do |t|
    t.cucumber_opts = "--require features #{suite[:features]} --profile html_report #{ENV['CUKES_OPT']}"
  end
end

desc "Enqueue a Test"

task :enqueue, [:entorno, :browser, :test, :cukes_opt] do |t, args|
  params = Hash.new
  params[:cukes_opt]=args.cukes_opt
  params[:entorno]=args.entorno
  params[:browser]=args.browser
  params[:test]=args.test
# Resque.redis = '10.254.21.185:6379'
  Resque.enqueue(StartScript,params)
end

OSX优胜美地的一切运行顺利。我在Windows上只有这个问题。

0 个答案:

没有答案