lib/serial_spec.rb in serial-spec-0.2.0 vs lib/serial_spec.rb in serial-spec-0.2.1
- old
+ new
@@ -2,15 +2,25 @@
require "serial_spec/version"
require "serial_spec/it_expects"
require "serial_spec/parsed_body"
require "serial_spec/request_response"
require "inheritable_accessors"
+begin
+ require 'active_model_serializers'
+ require 'bson'
+rescue LoadError
+end
module SerialSpec
extend ActiveSupport::Concern
include ItExpects
include RequestResponse
include RequestResponse::Helpers
+ if defined?(ActiveModel::Serializer)
+ require "serial_spec/request_response/provide_matcher"
+ include RequestResponse::ProvideMatcher
+ end
+
SERIAL_VALID_VERBS = %w{GET POST PUT PATCH DELETE OPTIONS HEAD}
module ClassMethods
def with_request(request_str, params={}, envs={}, &block)