Back when my test library was running on Watir 2.0.4/Ruby 1.8.7 I was able to use test/unit/testsuite to run a batch of tests in a suite that could run a defined list of test concurrently (see below):
require 'test/unit/testsuite'
require 'test/unit/ui/console/testrunner'
require 'foo1.rb'
require 'foo2.rb'
class Foo
def self.suite
suite = Test::Unit::TestSuite.new(Foo)
suite << foo1.suite
suite << foo2.suite
return suite
end
end
Test::Unit::UI::Console::TestRunner.run(Foo)<code>
Now I’m using Watir-webdriver on Ruby 1.9.2, this doesn’t seem to work:
C:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file >to load -- test/unit/testsuite (LoadError)
from C:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from testsuite.rb:6:in <top (required)>'
from -e:1:inload'
from -e:1:in `'
What are other people doing to string a batch of tests in a suite?
Thanks,
GJHmf
So that this question has an answer, as mentioned in the comments, the problem was that the test-unit gem was not installed.
The test-unit gem used to be included in the default installation of Ruby 1.8.7. In Ruby 1.9, it was replaced by the minitest gem, which is why you now have to manually install it.
To use the same version of test-unit that was in Ruby 1.8.7:
gem install test-unit -v 1.2.3
Or the latest version:
gem install test-unit
Related
I am trying to build the example gem from here following the mruby documentation for building gems.
I'm on a Mac OS Catalina, and I have installed RVM to manage my installation mruby. Right now which ruby returns /Users/mdorier/.rvm/rubies/mruby-2.0.1/bin/ruby so I can see that mruby is used.
The example gem above has an mrbgem.rake file, so even though the documentation doesn't explain how to build the gem, I suppose rake should be invoked in that directory. I didn't have rake installed, so I tried to install it with gem install rake, but it seems that Mac OS's native gem executable in /usr/bin got invoked, apparently installing the normal ruby's rake gem. When I call that rake, it doesn't find a Rakefile in the directory. If I specify rake -f mrbgem.rake, it tells me NameError: uninitialized constant MRuby.
I see that mruby doesn't have a gem command but seems to have a mgem that can be installed with gem. I installed it. I see that there is a mruby-rake mgem available, which I activated using mgem add mruby-rake, but it doesn't change what the rake command points to.
Can someone explain how I can install and use the proper rake command to build this mruby gem?
I am trying to install redmine_contacts plugin for my redmine 2.2.3.0 (which is installed using BITNami installer), as in readme.rdoc:
Copy redmine_contacts plugin to {RAILS_APP}/plugins on your redmine path
Run bundle install --without development test RAILS_ENV=production
Run rake redmine:plugins NAME=redmine_contacts RAILS_ENV=production
The first two steps was successful, but last executing last command, following error would occur:
(in /home/.../redmine-2.2.3-0/apps/redmine/htdocs)
Could not find sprockets-2.2.1 in any of the sources
Run bundle install to install missing gems.
To see if the sprockets library is installed by executing command: #bundle show sprockets, it shows a newer version of this library is installed:
/var/lib/gems/1.8/gems/sprockets-2.2.2
I think somehow the BitNami version of gem which is installed is not compatible with the sprockets-2.2.2 on the system and it requires 2.2.1. Maybe you should change to that version.
Try something like:
gem install sprockets -v 2.2.1
I'm getting the following error when trying to fire up script/console for my rails 2.3.15 app, after upgrading from rails 2.3.5. Does this mean the issue is with bundler 1.2.1 is not compatible with rack 1.1.3? Any help would be appreciated immensely.
usr/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/rubygems_integration.rb:157:in gem': can't activate rack (~> 1.0.1), already activated rack-1.1.3. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /home/developer/bigpink/vendor/rails/actionpack/lib/action_controller.rb:34
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/railties/lib/commands/server.rb:2
from script/server:3:inrequire'
from script/server:3
In my case, problem solved by the following steps:
Deleted the directory $PROJECT_ROOT/vendor/rails
Modified RAILS_GEM_VERSION in config/environment.rb
we used this process to upgrade Rails to 3.2.11 on our Heroku apps (as reported here)
stop – your Ruby on Rails (RoR) server
edit – appropriate line in gem file to read [one of]:
gem ‘rails’, ’3.2.11′
gem ‘rails’, ’3.1.10′
gem ‘rails’, ’3.0.19′
gem ‘rails’, ’2.3.15′
run – gem update
run – bundle update
run - bundle install
test – rspec # or test-driven dev’t framework of choice
launch – rails s
test – # interact with Rails server & explore if all is well
run – git add .
run – git commit -a -m “upgrade Rails server to ver. [x.y.z]“
run - git push # to github or rcs of choice
run - git push heroku # or to deployment server of choice
I created a build script using Rake & Albacore which builds a solution and executes unit tests. I am trying to set it up in TeamCity. I am getting this error.
Cannot start build runner: If you wan't to use bundler please install
it at first. The gem wasn't found in Gem paths of Ruby SDK with
interpreter: 'C:\Ruby187\bin/ruby.exe'.
Hide stacktrace
jetbrains.buildServer.agent.rakerunner.RakeTasksBuildService$MyBuildFailureException:
If you wan't to use bundler please install it at first. The gem wasn't
found in Gem paths of Ruby SDK with interpreter:
'C:\Ruby187\bin/ruby.exe'. Gem paths: C:/Ruby187/lib/ruby/gems/1.8
C:/Users/af/.gem/ruby/1.8
I added one parameter, where Albacore is installed. But, I am still getting the error.
GEM_PATH=C:\Ruby187\lib\ruby\gems\1.8\gems\albacore-0.3.4\albacore.gemspec
Ok finally was able to resolve the problem. I simply created a batch file that executes the rake task and instead of using "Rake Build Step" in Team city; used the command line build step and executed the batch file. It also gives me complete log of all the build steps, tests run etc.
Hopefully this will help someone else too. You don't need to setup a Rake Build Step as it turns out.
It's not clear that Albacore was missing. The error message indicates that TeamCity cannot find Rake itself!
Cannot start build runner
What was the exact Rake task configuration? Specifically the Ruby Interpreter configuration section? You can tell TeamCity exactly which Ruby to run, which will affect which gems are available (and Rake is just a gem).
It looks like you have a Ruby 1.8.7 installed and that you must have installed Albacore
cmd> gem install albacore
Do you also have Rake installed? In Ruby 1.8.7, the Rake gem was not included by default. You can list the machine's installed gems by
cmd> gem list --local
You'll should install Rake.
cmd> gem install rake
I'm not actually sure how you ended up getting this to work. What's the contents of the batch file? Do you have any other Ruby/Rake installed?
I'm using the following config/warble.rb in my hello-world-style application:
Warbler::Config.new do |config|
config.dirs = %w(app config tmp gems views)
config.includes = FileList["hello.rb"]
config.gems = ["sinatra"]
config.gem_dependencies = true
end
Now when I run jruby -S warble this is the error message:
warble aborted!
uninitialized constant Warbler::Jar::Pathname
org/jruby/RubyModule.java:2526:in `const_missing'
Can anyone help me out with it? The application runs without problems when executed directly so it looks like I have all the required gems installed.
Environment:
JRuby 1.6.1 (same with 1.5.6)
Sinatra 1.2.6
Warbler 1.3.0
Windows XP
Ubuntu 10.04.1
I've found a workaround for this that works with both ruby and jruby.
Instead of specifying the gems inside config/warble.rb I've installed the Bundler gem and created Gemfile in the root folder of my application with the following content:
source :rubygems
gem "sinatra"
With that removed from the config/warble.rb file the actual content of this file looks like this:
Warbler::Config.new do |config|
config.includes = FileList["hello.rb"]
end
To summarize:
gems go into the Gemfile
application files go into the config/warble.rb file
As it turns out there's an obvious bug in warbler preventing this functionality to work under jruby 1.6.1 and ruby 1.8.7 (don't know about other versions because I didn't test it).
Take a look here for a quick fix:
https://github.com/padcom/warbler/commit/b4b24e17dee5bb98525203c82519a8901874ef81