Sha256: 61d2e4538494699f0fc41549a849c7dddf27d3c33b816c9306453be51eab9991

Contents?: true

Size: 755 Bytes

Versions: 5

Compression:

Stored size: 755 Bytes

Contents

require 'spec_helper'

module MongoModel
  specs_for(Document, EmbeddedDocument) do
    shared_examples_for "ActiveModel" do
      begin
        require 'minitest/assertions'
      rescue LoadError
        require 'minitest/unit'
      end
      
      include Minitest::Assertions
      
      attr_accessor :assertions
      before(:all) { self.assertions = 0 }

      include ActiveModel::Lint::Tests

      ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m|
        example m.gsub('_',' ') do
          send m
        end
      end

      let(:model) { subject }
    end
    
    define_class(:TestModel, described_class)
    subject { TestModel.new }
        
    it_should_behave_like "ActiveModel"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mongomodel-0.5.5 spec/mongomodel/concerns/activemodel_spec.rb
mongomodel-0.5.4 spec/mongomodel/concerns/activemodel_spec.rb
mongomodel-0.5.3 spec/mongomodel/concerns/activemodel_spec.rb
mongomodel-0.5.2 spec/mongomodel/concerns/activemodel_spec.rb
mongomodel-0.5.1 spec/mongomodel/concerns/activemodel_spec.rb