Running all stories in a directory

I have a bunch on non-rails stories, and I want to run them all with
either a rake task or a script.

I tried the all.rb approach from rails, but is doesn’t seem to work.

I do this basically…

dir = File.dirname(FILE)
tests= []
%w(story1 story2 story3).each do |f|
tests << File.join(dir, f) + “.rb”
end

puts “Testing: #{tests.join(’,’)}”

tests.each do |file|
require file
end

Should this work?

Some of the stories run OK, but some seem to not be setup properly, they
run fine if run
individually from the command line as…

ruby story2.rb

Jim M. wrote:

tests << File.join(dir, f) + ".rb"

Some of the stories run OK, but some seem to not be setup properly, they
run fine if run individually from the command line as…

ruby story2.rb

This does work BTW…

replace

require file

with

system(‘ruby’, ‘file’)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs