Test Factory only if object respond_to :valid?

If I use Factory Girl for non-AR objects, I Am get failed test, because this object does not have valid? method.
```
FactoryGirl.define do
  factory :bundle, class: Hash do
    initialize_with do
      { test: :fail }
    end
  end
end
```