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-2.2.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.2.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.1.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.1.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.9 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.8 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.6 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.5 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.4 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.3 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.2 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.1 lib/active_record/acts_as/matchers.rb
active_record-acts_as-2.0.0 lib/active_record/acts_as/matchers.rb
active_record-acts_as-1.0.8 lib/active_record/acts_as/matchers.rb