The most common use case for Ruby's #collect is to call a method on each list element and collect...
In order to monitor a Rake task using God your Rake file must write a file with its process ID...
...check if the test travels in time like here: Given the date is 2017-10-20 When I sign in Then I should see "Welcome!" What happens here is that...
RSpec lets you define the arguments with which you expect a method to be invoked: subject.should_receive(:say).with('hello...
Capybara will match elements outside of a page's tag. For example, the step definitions below match nodes in a...
If you want to stop getting notified about new messages in a Skype chat (but not leave it altogether), you...
Looks simpler than inaction_mailer: gem install mailcatcher mailcatcher Setup Rails to send mails to 127.0.0.1:1025. Usually you want...
grep -r doesn't work on Solaris. You can only grep on files in the current directory. A workaround is...
When you require the Ruby debugger to be available from your Rails console (e.g. you want to inspect a method...
Using git rebase can be painful but luckily you can resort to cheating with git reset and committing anew.
When adding a new field to your model's database table, don't set any defaults in the database.
Single step and slow motion for Cucumber scenarios can come in handy, especially in @javascript scenarios. # features/support/examiners.rb AfterStep('@slow_motion...
In order to open a MySQL shell without the need to enter user and password, you can say the following...
Oniguruma is an advanced regular expression engine for Ruby. Install Oniguruma with binary dependencies like this: sudo apt-get install...
Since version 11.10 Opera provides support for linear gradients using -o-linear-gradient. The syntax is pretty similar to Mozilla...
In case you have sensitive data within your RDS instance, you want to use encrypted connections between your application and...
Recently, we had an interesting lunch-break with the rails 3.1. asset-pipeline in production mode. Daniel Zahn made a...
Never use raise_error without specifying the Error you expect. expect { do_a_lot_of_complicated_stuff }.to raise_error...
You can use the step definition below to say this: Then the "Last name" field should have an error
When cucumber encounters a failing step in a @javascript feature, the selenium browser window instantly closes. Sometimes you do not...
You can use heredoc to avoid endlessly long lines of code that nobody can read. Heredoc strings preserve linebreaks and...
If Rails or Rake are complaining about a missing gem that is listed in your Gemfile.lock and the listed version...
You can use this shell command: uniq -u input.txt output.txt
This article explains why some regular expressions take years to match against certain strings. A common culprit are nested repetition...