mm
Nebojša Stričević

An independent Ruby on Rails and JavaScript consultant. Visit my website for more info.

Posts by: Nebojša Stričević

How to Deal With and Eliminate Flaky Tests

Introduction An essential property of an automated test and the entire test suite is its determinism. This means that a test should always have the same result when the tested code doesn’t change. A test that fails randomly is commonly called a flaky test. Flaky tests hinder your development experience, slow down progress, hide real bugs and, in the end, cost money. It makes sense to invest time in keeping…

Automatic Security Testing of Rails Applications Using Brakeman

Introduction Brakeman is a tool that scans a Ruby on Rails application for common vulnerabilities. It’s a static code analyzer that can help you find security problems before you release the application. Since you can introduce a vulnerability at any stage of you development process, it’s obvious that Brakeman should scan your application as often as possible, preferably on every commit. That makes it an ideal candidate for the continuous…

Testing Clojure With Expectations

Introduction Clojure is shipped with clojure.test — a library with basic features for writing tests. However, there are a few alternatives that aim to make writing tests more pleasant or more suitable for BDD. Expectations by Jay Fields is one of them, described as “a minimalist’s unit testing framework” with the slogan “adding signal, removing noise”. This article explains how you can install Expectations in your Clojure project. We will…

Testing Clojure Web Applications with Selenium

Selenium is a commonly used set of tools for automating browsers. It allows you to drive a browser interaction with a web page by writing code. It’s most often used to write browser-based tests for web applications. Tests can be executed in a development environment or even on a real application as part of a smoke test suite. Selenium provides support for most popular languages and browsers. This tutorial explains…

Testing Clojure web applications with Kerodon

Clojure standard library includes a general unit testing library clojure.test. There are several other libraries created for a specific purpose in mind. One of them is Kerodon, inspired by Ruby’s Capybara. Kerodon helps you test Ring-based web applications by simulating how a user would interact with your app. The goal of Kerodon is to provide a friendly interface for interacting with web applications in test code. For example, a test…

Setting Up the BDD Stack on a New Rails 4 Application

Introduction This tutorial guides you through generating a new Rails 4 application with RSpec and Cucumber as testing tools. If you’d like to learn how to set up a BDD stack on a Rails 5 application, this tutorial is the best next read for you. RSpec is a testing tool often used for writing unit tests, while Cucumber is a tool for writing acceptance tests. Both tools are popular choice…

How to write a custom Kerodon matcher

Kerodon provides a friendly API for interacting with web pages in tests. With Kerodon you write a test from the perspective of a user interacting with a web application from a browser. It provides helpers for visiting a page, clicking on a button or a link, interacting with a form and inspecting the page content. Kerodon API will be enough for writing most acceptance tests that don’t require JavaScript for…

How to Deploy a Compojure Application to OpenShift

Introduction OpenShift is Red Hat’s cloud computing platform as a service. It’s based on open source OpenShift Origin project. The platform officially supports a number of languages: Java, PHP, Ruby, Node.js, Python and Perl. Since the platform is open source, other languages and platforms are supported by community-maintained cartridges. A cartridge is a set of scripts and configuration files that prepares a gear for your application. Gears are containers for…