Skip to content

jpmoral/virtus-matchers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

virtus-matchers

RSpec matchers for Virtus

##Usage A model like:

class Foo
  include Virtus.model
  
  attribute :hello, String
  attribute :goodbye, String, default: 'Bye'
  attribute :name, String, strict: true
end

would have specs like:

describe Foo do
  it { is_expected.to have_attribute(:hello, String) }
  it { is_expected.to have_attribute(:goodbye, String).with_default("Hello") }
  it { is_expected.to have_attribute(:name, String).strict }
end

About

RSpec matchers for Virtus

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%