Essential Ruby gems?
We're starting to standardise on a Ruby-based testing framework, having had some very good results out of RSpec and Cucumber-based testing recently. As this is a large enterprise, we're going to attempt to put together a "standard" set of Ruby gems for testing, knowing we're only ever going to get it ~90% right because of the broad mix of technologies being used.
Key technologies we've identified so far that we need to be able to support:
- message transport layers: WebSphere MQ, Tibco (within our test cases, we need to be able to read/write messages & clear queues)
- databases: SQL Server, Oracle, Sybase (we need to be able to do CRUD operations on each of these as part of our test cases)
- user interfaces: Web, .NET, Java/Swing, Silverlight (ideally we'd be able to automate driving each of these UIs through an appropriate interface)
As a starting point, we've decided we want the following set of gems installed (in addition to those that come with Ruby itself):
- cucumber (plus hoe and other dependencies)
- rubywmq (for testing involving WebSphere MQ)
- webrat
- watir (for those cases where webrat won't cut it)
- rails (not so much for Rails itself, but for activerecord and the various DB drivers that come down as dependencies, as well as rake)
- ruby-oci8 (for Oracle)
For Silverlight apps, we hope to be able to test them through IronRuby, but that's very much unknown territory for us at this point.
Two questions:
- any other key gems we've missed? Stuff that you just can't live without? What's good/bad/ugly?
- any sources of reference for driving Java/Swing, Silverlight and .NET user interfaces? I'm aware of the RSpec book, but are there any others out there?
Thanks in advance
Answers (4)
A few very nice gems for irb/rails console...
Pry - gives you the ability to ls
, cd
around available objects. Show the source for methods, display rails models... and a significant amount of other features
irbtools - a bunch of tools collected together (including wirb, hirb, interactive_editor (let's you open emacs, vim etc.), coderay, ... list on the github page)
Zentest, it is very Important for testing
Also Mongrel or Passenger for application deployment
Nokogiri for parsing XML is another one
I would add
- Mocha. If you use Cucumber, Rspec or ActiveSupport, chances are it will get loaded automatically if installed.
- Test::Unit or RSpec. The first one isn't a GEM, it's a standard Ruby library. Personally I'm a Test::Unit guy rather than a RSpec user, however you might want to give RSpec a try.
- Shoulda Shoulda consists of test macros, assertions, and helpers added on to the Test::Unit framework.
- Remarkable Remarkable is a port of all Shoulda macros to RSpec.
Also you might want to use
Not strictly related to tests but always about code quality:
- Flay analyzes ruby code for structural similarities.
- Flog shows you the most torturous code you wrote.
- Reek a code smells detector for ruby
- Roodi parses your Ruby code and warns you about design issues you have based on the checks that is has configured.