Category: rails


How to run only one test in rspec

Mostly while developing its extremely convenient to be able to run just one particular describe block or it block. Rspec lets you do that using a combination of focus: true as well as adding...


How to test a private method in rspec

Since you cannot access a private method directly, in order to test a private method, you can make use of the ‘send’ method that is available on all objects. @obj = result =...


Auto update Gemfile when installing ruby gems

npm lets you save a module into your package.json file using the –save options. You can do the same in ruby, by installing a gem called ‘gemrat’ and then using that command to install...