Sha256: ad88ad393cd0349998b20452c76db5871e7beffc6c8551dc042216ac49bed591

Contents?: true

Size: 379 Bytes

Versions: 34

Compression:

Stored size: 379 Bytes

Contents

RSpec::Matchers.define :act_as do |actable|
  match do |actor|
    if actor.is_a?(ActiveRecord::Base)
      actor.class.acting_as?(actable)
    else
      actor.acting_as?(actable)
    end
  end
end

RSpec::Matchers.define :be_actable do
  match do |actable|
    if actable.is_a?(ActiveRecord::Base)
      actable.class.actable?
    else
      actable.actable?
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
active_record-acts_as-5.2.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-5.1.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-5.0.3 lib/active_record/acts_as/matchers.rb
active_record-acts_as-5.0.2 lib/active_record/acts_as/matchers.rb
active_record-acts_as-5.0.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-5.0.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-4.0.3 lib/active_record/acts_as/matchers.rb
active_record-acts_as-4.0.2 lib/active_record/acts_as/matchers.rb
active_record-acts_as-4.0.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-4.0.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-3.1.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-3.0.2 lib/active_record/acts_as/matchers.rb
active_record-acts_as-3.0.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-3.0.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.5.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.4.2 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.4.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.4.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.3.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.3.0 lib/active_record/acts_as/matchers.rb