Posts tagged with "Ruby"

RSpec Example Filtering for Multiple Version Testing

Authoring a client library for an upstream service is often challenging, but testing and preventing regressions against upstream API changes is sometimes impossible. This post discusses using RSpec example metadata filtering as a way to test against different c...

The Cleanroom Pattern in Ruby

I recently gave a talk at Philly.rb, the Ruby meetup in Philadelphia, PA entitled "The Cleanroom Pattern - More safely evaluating DSLs with Ruby". You can watch the full Cleanroom DSL video online, but I decided to also write the contents of the talk into a blo...

Chef 12 drops support for Ruby 1.8

Chef has long supported Ruby 1.8.7 and REE, even beyond the announced EOL periods from the Ruby maintainers. The continued support for Ruby 1.8 has been a burden for cookbook developers who want to use the "new" Ruby 1.9 features, but must retain support for Ru...

Unit and functional testing git with RSpec

If you have ever written a Ruby application that interacts with git, you are probably already aware of the pains of testing such behavior. As if checking if git is installed at the proper version and catching all the crazy typos was not enough, git's algorithm'...

Using gems with Chef

Installing gems with Chef is relatively painless. Most of the time, you can use the gem_package resource, which behaves very similarly to the native package resource: gem_package 'httparty' You can even specify the gem version to install: gem_package 'httparty'...

Handle Faraday::Error::ConnectionFailed with middleware

Faraday is a really nice, middleware-based HTTP client for Ruby. For simple libraries, I recommend HTTParty, but Faraday is a really awesome solution when you need full control over the complete stack. However, Faraday has one feature/flaw that I have found. If...