Sha256: 1067099d0d486c82f4189a6f7ba4269f973364af3c265bb48ec9fb7ab6118da0

Contents?: true

Size: 780 Bytes

Versions: 1

Compression:

Stored size: 780 Bytes

Contents

require 'assert'
require 'mr/record'

require 'much-plugin'

module MR::Record

  class UnitTests < Assert::Context
    desc "MR::Record"
    setup do
      @record_class = Class.new do
        include MR::Record
        self.model_class = FakeTestModel
      end
    end
    subject{ @record_class }

    should have_accessors :model_class

    should "use much-plugin" do
      assert_includes MuchPlugin, MR::Record
    end

  end

  class InstanceTests < UnitTests
    desc "instance"
    setup do
      @record = @record_class.new
    end
    subject{ @record }

    should have_accessors :model

    should "build a model if one hasn't been set" do
      assert_instance_of FakeTestModel, subject.model
    end

  end

  class FakeTestModel
    include MR::Model
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mr-0.35.2 test/unit/record_tests.rb