Introduction While unit tests usually make up the core of an application’s tests, integration tests are often just as important. An integration test is named as such because it integrates with some other piece of technology. In this tutorial, you will learn how to integrate a Play Framework web application with an HTTP server to […]
Category Software Engineering
Testing Ansible Roles with Semaphore
Introduction If you are even slightly familiar with configuration management, you have probably heard of Ansible before. In short, Ansible is a configuration management tool that allows you to manage nodes over SSH or PowerShell written in Python. Ansible then uses YAML to express reusable descriptions of systems. The most simplistic usage is sending ad-hoc […]
Writing One-Liner RSpec Tests in Rails with Shoulda-Matchers
Introduction Shoulda Matchers provides Test::Unit and RSpec-compatible one-liners that test common Rails functionality. It helps you write tests that would otherwise be much longer, more complex, and error-prone. Using shoulda-matchers for testing simplifies the entire process. Let’s take a look at shoulda-matchers in action, compared to its RSpec-only equivalent. One-Liner ActiveModel Tests Below is an […]
Getting Started with BDD in Laravel
Introduction For many developers BDD is a complicated subject, and getting started with it the right way often does not come easy – especially when you need to implement it into an existing framework. This tutorial aims to help you get a BDD-powered Laravel project up and running in very little time, introducing you to […]
Video Tutorial β Continuous Integration and Deployment for Elixir
In May we had the pleasure of releasing official continuous integration and deployment support for Elixir projects on Semaphore. We wanted to get to know the Elixir community better, so we started talking to developers working with Elixir. We have had the pleasure of working with Josh Adams from Elixir Sips, who has made two […]
Introduction to Writing Acceptance Tests with Cucumber
Introduction In this article, we’re going to look at Cucumber as a tool for writing your customer acceptance tests. More specifically, we’re going to look at how a Cucumber acceptance test might look in practice. After reading this article, you should have a clearer picture of why Cucumber is a good candidate for writing your […]
How to Use Custom RSpec Matchers to Specify Behaviour
Introduction Test code needs to be both run by computers and read by humans. It therefore needs to be well-factored and use the domain language. At the end of this tutorial, you will have seen how you can use use RSpec‘s custom matchers to write better tests that are DRY, quick to write and easy […]
How to Set Up a Clojure Environment with Ansible
Introduction In this tutorial, we will walk through the process of setting up a local environment for Clojure development using the Ansible configuration management tool. Ansible and Clojure are a perfect fit, as both place an emphasis on simplicity and building with small, focused components. While we will not cover the Clojure development process specifically, […]
How to Use Capistrano to Deploy a Rails Application to a Puma Server
Introduction Deploying a Ruby on Rails application involves a number of steps, such as copying source code files, running database migrations, pre or post-compiling assets and restarting the web server. Our goal as developer should be to automate this procedure down to a single command we can run at any time. There are tools that […]
Applying BDD to Ruby on Rails Web Applications
Introduction Behavior-driven development (BDD) is a software development practice of working in a short feedback loop, where we consistently apply test-driven development to every new feature we are exploring and working on. For a detailed introduction to the practice of BDD, you should read our article Behavior-driven Development. This article focuses on applying these principles […]
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 […]
Unit Tests for Chef Cookbooks With ChefSpec
The Agile movement brought many fresh ideas which enriched the world of software development and changed way how we look to it. This philosophy left marks on how we look our infrastructure too. By treating the infrastructure equally important as other parts of the project, there was a need for making sure that infrastructure is […]
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 […]
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 […]
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 […]