Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSpec matchers #91

Open
aried3r opened this issue Aug 9, 2017 · 0 comments
Open

RSpec matchers #91

aried3r opened this issue Aug 9, 2017 · 0 comments

Comments

@aried3r
Copy link

aried3r commented Aug 9, 2017

Would you be interested in shipping RSpec matchers with this gem?

I only have two in mind actually for now:

# unread_matchers.rb
RSpec::Matchers.define :be_readable do
  # check to see if the model has `acts_as_readable` declared on it
  match { |actual| actual.is_a?(::Unread::Readable::InstanceMethods) }
end

RSpec::Matchers.define :be_a_reader do
  # check to see if the model has `acts_as_reader` declared on it
  match { |actual| actual.is_a?(::Unread::Reader::InstanceMethods) }
end

# message_spec.rb
it { is_expected.to be_readable }

# user_spec.rb
it { is_expected.to be_a_reader }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant