RSpec::Matchers.define :have_instance_variable_value do |name, value|
  match do |actual|
    actual.instance_variable_defined?("@#{name}") &&
      actual.instance_variable_get("@#{name}") == value
  end
end