Module: ROM::Lint::TestEnumerableDataset

Extended by:
Test
Defined in:
lib/rom/lint/test.rb

Overview

This is a simple lint-test for a gateway dataset class to ensure the basic behavior is correct

Examples:


class MyDatasetLintTest < Minitest::Test
  include ROM::Lint::TestEnumerableDataset

   def setup
     @data  = [{ name: 'Jane', age: 24 }, { name: 'Joe', age: 25 }]
     @dataset = MyDataset.new(@data, [:name, :age])
   end
 end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the expected data



89
90
91
# File 'lib/rom/lint/test.rb', line 89

def data
  @data
end

#datasetObject (readonly)

Returns the dataset instance



84
85
86
# File 'lib/rom/lint/test.rb', line 84

def dataset
  @dataset
end

Class Method Details

.define_test_method(name, &block) ⇒ Object Originally defined in module Test

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Defines a test method converting lint failures to assertions

Parameters:

  • name (String)