Add unit tests for Trigram conditions

This also includes a major overhaul of this whole spec file, collapsing
much setup into some `let`s and using an OpenStruct for the config
object.
Require 'ostruct' for Ruby < 2.0
Need rspec >= 2.14 for `expect` syntax
Merge pull request #143 from stevenharman/add_unit_tests_for_trigram_feature

Add unit tests for Trigram conditions