Read more

RSpec 1.x matcher for delegations

Dominik Schöler
July 08, 2014Software engineer at makandra GmbH

The attached RSpec matcher allows for comfortably testing delegation.

Examples

describe Post do
  it { should delegate(:name).to(:author).with_prefix } # post.author_name
  it { should delegate(:month).to(:created_at) }
  it { should delegate(:year).to(:created_at) }
end

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Credits go to txus Show archive.org snapshot . See the attached link for an RSpec 2+ version.

Posted by Dominik Schöler to makandra dev (2014-07-08 14:58)