require 'spec_helper' describe 'Yema::Virtus::Rule::Format' do subject { described_class.new(name: value).errors } let(:described_class) do Class.new do include Yema::Virtus::Validations attribute :name, String, strict: :none, format: /abc/ self end end it_behaves_like "valid resource", "abc" it_behaves_like "valid resource", "1abcs" it_behaves_like "invalid resource", "" it_behaves_like "invalid resource", nil it_behaves_like "invalid resource", false it_behaves_like "invalid resource", 1 end