Reading user input in console applications is usually done using Kernel#gets. Stubbing that can be a bit hairy.
When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is...
As you may know, HAML expands data attributes that are given as a hash: %div{ data: { count: 3 } }
PostgreSQL uses the C library's locale facilities for sorting strings: First, all the letters are compared, ignoring spaces and...
Let's say you have two factories that share some attributes and traits: FactoryBot.define do factory :user do screen_name...
Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...
As your Rails project grows, you will accumulate a number of small patches. These will usually fix a bug in...
to create a Gallery that has a name and has_many :images, which in turn have a...
Connect to your IMAP server. If you have SSL enabled: openssl s_client -connect your-server:993 if your server...
When you find yourself in the situation that you would like to define a custom matcher in your specs, but...
Many of our developers love to use the "awesome" window manager on Linux. However, RubyMine dialogs occasionally defocus while typing...
When you have a localized website, you may want to redirect users to their preferred language when they visit the...
Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x...
When you paste copied code with CTRL+V, RubyMine will change the indentation of the pasted code. You can prevent...
ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...
Helix allows you to implement performance-critical code of your Ruby app in Rust, without requiring glue code to bridge...
When dealing with time zones in Rails, there is one key fact to keep in mind: Rails has configurable time...
Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...
When building a form with a file select field, you may want to offer your users a live preview before...
This gem gives you a rake task db:seed:dump do create a db/seeds.rb from your current database state.
Cucumber's docstrings let you add long strings to a step like this: # foo.feature Given this text: """ First line
Instead of using this hack you might want to use MariaDB 10.x which can work with both old and...
OAuth requires a set of params to be carried along requests, among which a nonce. Some libraries pass these along...
If you want to access top-level constants inside a BasicObject class, you need to prefix them with ::.