github.com

The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall...

If you need to look at the list of methods that are called upon certain events (like before/after saving etc...

This can be helpful when you need the latest file inside a directory for processing in a shell script:

If you did file operations inside a shell or for example using Nautilus, it can take quite a while until...

If you get an ActiveRecord::RecordNotSaved error, a method inside one of your model's callback chains (before_save etc...

37signals.com

Lately, we’ve been exploring ways to offer web apps that perform like native apps on mobile devices. For this...

Capybara's has_css? matcher has a couple of options you might find useful. Check that a selector appears a...

Even when you're using bundler, it might be significant in which order your gems are listed in your Gemfile...

makandra dev
ruby-doc.org

[ ] [ ]= ** ! ~ + - * / % + - >> << & ^ | <= < > >= <=> == === != =~ !~ && || .. ... ? : = %= { /= -= += |= &= >>= <<= *= &&= ||= **= defined? not or and if unless while until begin/end For more information see Table 18.4 in The Pragmatic Programmer's...

A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...

Inside before :each blocks you can refer to variables that you introduce via let later on. They do not need...

If you have several submit elements (inputs or buttons with type="submit") that each cause different things to happen (e.g...

These steps are now part of Spreewald. This note describes a Cucumber step that lets you write this:

makandra dev

Note that you should disable the Java plug-in in your browsers after installation. Ubuntu >= 12.04 Java 11

Cucumber step argument transforms can be a powerful way to make your steps more flexible. Note however that if your...

testobsessed.com

So this is the simulation that I use in my Agile Testing class, as well as in other contexts where...

RSpec's context (which is basically an alias for describe) takes over your whole application. No object may have its...

In /etc/crontab In /etc/cron.d/* In /etc/cron.hourly/* In /etc/cron.daily/* In /etc/cron.weekly/* In /etc/cron.monthly/* In the personal crontab of any user. This...

We use RTeX for PDF exports. While converting LaTeX to PDF, RTeX opens a temporary file which has problematic permissions...

web.archive.org

With its you can switch the subject of an example to a method value of the current subject: describe Array...

beust.com

It’s pretty common for projects hosted on GitHub to receive “pull requests”: requests from people who have cloned your...

Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...

youtube.com

power-rake db:migrate VERSION=20100913132321 By default the environments development, test, cucumber and performance are considered...

To only run a single describe/context block in a long spec, you can say spec spec/models/note_spec.rb:545 ... where the describe...