When you need to zip up files in Ruby, use zipruby. sudo gem install zipruby You can add existing files...
This is now part of geordi. Please don't follow the instructions below, if you use geordi. Inspired by the...
When you have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want...
If you're writing a spec for an application using Resque, you may need to work off queues manually without...
Note: While the solution in this card should still work, we prefer another solution now: Hide your Selenium browser window...
This finally works: User.any_instance.should_receive(...) as does User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working...
In order to use different encodings than ASCII for HTTP headers use the following syntax: Header-Key: Header-Value; Parameter...
Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...
Note: Consider using MATE instead of Gnome 3 on newer system Awesome is a very good tiling window manager that...
With gem dependency it is possible to check the dependencies for your gem before you install it.
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
I've recently encountered a weird problem with specs making lots of SOLR queries using the acts_as_solr plugin...
If you need to parse a large XML file (> 20 MB or so), you should parse it in chunks, otherwise...
These steps are now part of Spreewald. Since Capybara 0.4.1 a within scope will only look at the first element...
The step definition below allows you to write: Then I should see a link labeled "Foo" But I should not...
When you render a nested form for a Movie which has_many :actors, you want to render the right number...
To test if you can connect to a host using password authentication and explicitly deny public key authentication:
Here is how to switch your Selenium to Chrome: Make sure you've got a recent version of chromedriver in...
If you stub a method or set expectations with should_receive these stubbed methods may also yield blocks. This is...
This is somewhat similar to the touch command of Linux: FileUtils.touch 'example.txt', :mtime => Time.now - 2.hours If you omit the :mtime...
If you need Google Chrome to run in English, and your system locale is a non-English one, you have...
When some of your Google contacts are no longer synchronized with your e-mail client or mobile phone, those contacts...
Sometimes, when running a rake task, RubyGems 1.8.5 raises an error: rake aborted! undefined method `specifications' for "/usr/lib/ruby/gems/1.8":String
My RubyMine (and it seems like many other Java GUI applications) crashes the Compiz window decorator almost every time on...