Vagrant – Running Rails server in the background

Let’s say when you boot up or restart your virtual machine, you want to run the Rails server in the background for your Rails application. It is pretty easy. First, let’s create a function for the script block. Put following code on the top of the Vagrant file. def start_rails_server <<-SHELL cd /vagrant # start …

Setting up Ruby SDK for RubyMine with Vagrant

This article is about how you can configure to use the Ruby SDK in your Vagrant image with RubyMine. For this, I have used the  joshfng/railsbox Vagrant image because I was using that image for a Rails project.  First you have to find where is your Ruby interpreter located for your project. Let’s assume your …

Think differently when the current tests fails

This is a lesson learned from work. SO we use Rials in our project at the workplace. SP for a new requirement, we had to have a validation for a particular attribute of a model.   The requirements were specific on where the validation should happen. Say for example for what controller actions. However, the initial …

Be careful when using loops in Jasmine specs

Your test automation code is an important tool to evaluate your application.  You must ensure your test code is working/testing as you want it to be. the automated tests give confidence for the developer that the application behaves as expected and things are not broken after they change the code. Recently, at our QA phase, the …

Go Programming Language: An Introductory Tutorial

What’s the Go Programming Language? Go is a recent language which sits neatly in the middle of the landscape, providing lots of good features and deliberately omitting many bad ones. It compiles fast, runs fast-ish, includes a runtime and garbage collection, has a simple static type system and dynamic interfaces, and an excellent standard library. …

Trying out Ansible on local mode

So you might be interested running ansible to configure your local machine. In this article, I’m going to show you the minimum steps that need to install Vim  using Ansible on an Ubuntu host machine. 1. Install latest Ansible version from apt $ sudo apt-get install software-properties-common $ sudo apt-add-repository ppa:ansible/ansible $ sudo apt-get update …

Trailing whitespaces: what you gonna do about it?

What is a trailing whitespace? Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline. Background Few months ago, it was raised that PR submitted code tend to have trailing whitespace changes in code diff along with other “real” code changes. This whitespace change is a diff …

Having a newline character at end of file

Background/problem/question: When you create a newfile, and push it to Github, in code diff view, it will say no newline at end of file. Sometimes text editors would also add an EOF newline, if they noticed that the file being edited does not end in a newline, when they are saved (usually it is configured …

Use different conditions to test methods

Let’s say that you have a function that takes an HTML <ul> structure and check items. For simplicity, our method would check if each item in the list has a link pointing to type of resource (A). So here can write a test that takes a list with items containing resource A links. Here we expect …

Don’t commit the first thing that works

I was working on a bug fix on our application with another fellow programmer. First we understood the root cause of the bug and what makes it to happen. All that was good. Then we thought of a solution and applied the first fix that I thought. Code works and bug is fixed, happy days. …