Post originally published on https://rossta.net. Republished with author’s permission. A useful feature of RSpec is the ability to pass metadata to tests and suites. You may already be familiar with how Capybara uses the :js option to enable the JavaScript driver. describe “a javascript feature”, :js do # tests run against the Capyabara.javascript_driver end Capybara […]
Category Software Engineering
Video Tutorials on Setting up Continuous Integration and Deployment with Semaphore
We at Semaphore are all about continuous learning and sharing knowledge β our team spends a lot of time learning from various online and offline sources, as well as sharing our knowledge by writing and editing tutorials on TDD and BDD best practices, which we publish in the Semaphore Community. One of the YouTube channels […]
Test-driven Development of Go Web Applications with Gin
Introduction This the second part of the tutorial on building traditional web applications and microservices in Go using the Gin framework. In the first part of the tutorial, we set up a project and built a simple application using Gin that displayed a list of articles and the article details page. This part of the […]
Mocks and Monkeypatching in Python
Post originally published on http://krzysztofzuraw.com/. Republished with author’s permission. Introduction In this post I will look into the essential part of testing β mocks. First of all, what I want to accomplish here is to give you basic examples of how to mock data using two tools β mock and pytest monkeypatch. Why bother mocking? […]
Testing Components in Angular 2 with Jasmine
Introduction In this article, we’ll look at how to unit test components built with Angular 2. Components are the centerpiece of Angular 2. They are the nucleus around which the rest of the framework is built. We’ll explore what a component is, why it is important, and how to test it. Prerequisites Before starting this […]
How to Test in Go
Post originally published on http://www.calhoun.io. Republished with author’s permission. If you have spent any time learning how to program, you have likely run across many references to testing. Everyone talks about testing, and everyone seems to unanimously agree that you should be testing, but what exactly does that entail? In this post, I will try […]
Continuous Deployment for Static Sites with Docker, AWS, and Ansible
Introduction Static sites are popular because they are easy to work with, highly performant, and easily deployed. Static sites are also a nice test bed for continuous deployment practices due to their simplicity. This tutorial demonstrates how to use Docker, Middleman, Ansible, and AWS to build a continuous deployment system so your site’s infrastructure and […]
Testing Angular 2 HTTP Services with Jasmine
Introduction Angular.js was designed with testability in mind, so it was easy to write tests in it. Years passed and Angular 2 came out, completely rewritten from the ground up. They followed the same guidelines, only syntax changed, but writing the tests remained easy. It is important to write tests for our code β by […]
Isolate Side Effects in Ruby
Post originally published on http://www.rubypigeon.com. Republished with author’s permission. What Are Side Effects? Side effects are any observable change caused by calling a function. For a function to be free of side effects, it must do nothing other than provide a return value. These are examples of side effects: Writing to a file, Printing output […]
How to Reduce Controller Bloat with Interactors in Ruby
Introduction Let’s consider a hypothetical situation β You’ve been working on a Rails application for about a year. When the application was new and its functionality limited, you could add features relatively simply by spinning up a new controller, model and view or β worst case β add a few lines to an existing controller, […]
How to Test React and MobX with Jest
Introduction If you’re developing React applications, then you know that the React community has been bursting with new ideas and tools over the last year. When investigating any new technology to incorporate into a stack, we should consider if it either makes the workflow much easier, or solves a key problem. MobX and Enzyme are […]
Setting Up Angular 2 with Webpack
Introduction In this article, we’ll be looking at the setup required to create an Angular 2 project with unit tests. We’ll cover various required technologies and how to write each of their configurations. Let’s dive in. Prerequisites and Assumptions Before getting started, we should make sure that we have everything we need. It is assumed […]
An Approach to Testing Your User Interface More Efficiently
Post originally published on http://www.ontestautomation.com. Republished with author’s permission. I am pretty skeptical about writing automated tests that interact with the application under test at the user interface level. These UI tests tend to be: Slow in execution, since they are typically end-to-end tests from an application-layer perspective, and Demanding when it comes to maintenance, […]
How to Test Rails Models with Minitest
Introduction In this tutorial, we will cover how to test Ruby on Rails models with the Minitest testing suite. After completing this tutorial, you will have learned the following: What to test in Rails models, How to test the various aspects of a Rails model, such as validations, associations, scopes, and extra business logic methods, […]
Getting Started with Protractor and Cucumber
Introduction If you develop AngularJS applications, then you have probably heard of Protractor. It is an end-to-end testing framework built specifically for AngularJS. It allows you to create tests that interact with a browser like a real user would. One of the greatest features of Protractor is its ability to “be smart” about waiting for […]