The following post will show you how to implement Capybara in Rails to simulate user interactions.
Capybara is a ruby gem for writing integration and system tests. System tests are basically testing that click around your web application to check if all the functionality is working as expected.
Using Capybara, you can:
Crawl your application (like a…
Advanced Tutorials
Docker is a great tool for developers; it provides an easy way to create and manage containers. You can implement Docker in Rails with this tutorial.
If you are unfamiliar with containers, think of it as a way to isolate your application from the rest of the system. This way, you can run multiple applications on…
Ruby Thread is a way to run code in parallel with other code. They can be useful for doing things like fetching data from a web service and processing it while the user is still interacting with the UI.
They can also help you make use of all the processors in your computer for things like…
Begin and Rescue keywords in Ruby allow to execution of some code if an error occurs during the program's implementation.
Rescuing Standard Errors
The rescued code will execute only if a StandardError or its descendants occur.
For example:
begin
some_undefined_method
some_undefined_variable
rescue
puts "An error occurred."
end
It's also possible to handle different speeches of errors:
begin
…
Design patterns in Ruby (as well as in the rest of the languages ) are a standard solution to a common problem in software design. They are not specific to any programming language and can be implemented in many different ways.
There are many different design patterns, but some of the most common ones…