Guys, I’m trying to do something a little exotic here, using RSpec to
test
Objective-C code through MacRuby.
I mean the major problems I already solved (how to load Objective-C into
ruby, install rspec for native macruby…), but in this case I just
can’t
use the “spec” command, because the ruby command is dispatched directly
by
XCode… Im trying this:
require “rubygems”
require “rspec”
require “rspec/autorun”
RSpec.configure do |config|
config.mock_with :rspec
end
Loading all the Ruby project files.
main = File.basename(FILE, File.extname(FILE))
dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
Dir.glob(File.join(dir_path, ‘*_spec.{rb,rbo}’)).map { |x|
File.basename(x,
File.extname(x)) }.uniq.each do |path|
if path != main
require(path)
end
end
But it’s not working… this script just load the spec files using
require,
I meant it will work, but it don’t…
What Im missing in order to make specs to run after files are loaded?
Wilker Lúcio
Kajabi Consultant
+55 81 82556600