Sha256: b0000948112b8034fea5364cc56df07ed66f0a36043e10282c4d3295cab00b68

Contents?: true

Size: 513 Bytes

Versions: 18

Compression:

Stored size: 513 Bytes

Contents

# spec/support/active_model_lint.rb
# adapted from rspec-rails:
# http://github.com/rspec/rspec-rails/blob/master/spec/rspec/rails/mocks/mock_model_spec.rb

require 'test/unit/assertions'

shared_examples_for "ActiveModel" do
  include ActiveModel::Lint::Tests
  include Test::Unit::Assertions

  # to_s is to support ruby-1.9
  ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m|
    example m.gsub('_',' ') do
      send m
    end
  end

  def model
    subject
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
amfetamine-0.4.2 spec/helpers/active_model_lint.rb
amfetamine-0.4.1 spec/helpers/active_model_lint.rb
amfetamine-0.4.0 spec/helpers/active_model_lint.rb
amfetamine-0.3.3 spec/helpers/active_model_lint.rb
amfetamine-0.3.2 spec/helpers/active_model_lint.rb
amfetamine-0.3.1 spec/helpers/active_model_lint.rb
amfetamine-0.3.0 spec/helpers/active_model_lint.rb
amfetamine-0.2.12 spec/helpers/active_model_lint.rb
amfetamine-0.2.11 spec/helpers/active_model_lint.rb
amfetamine-0.2.9 spec/helpers/active_model_lint.rb
amfetamine-0.2.7 spec/helpers/active_model_lint.rb
amfetamine-0.2.6 spec/helpers/active_model_lint.rb
amfetamine-0.2.5 spec/helpers/active_model_lint.rb
amfetamine-0.2.4 spec/helpers/active_model_lint.rb
amfetamine-0.2.3 spec/helpers/active_model_lint.rb
amfetamine-0.2.1 spec/helpers/active_model_lint.rb
amfetamine-0.2.0 spec/helpers/active_model_lint.rb
amfetamine-0.1.5 spec/helpers/active_model_lint.rb