Sha256: 38b0c426ddade9f8638c81cf9c64a868c280c625384ea8cd34b164daf3697944

Contents?: true

Size: 617 Bytes

Versions: 13

Compression:

Stored size: 617 Bytes

Contents

require 'bundler/setup'
require 'pathname'

root_path   = Pathname(__FILE__).dirname.join('..').expand_path
lib_path    = root_path.join('lib')

$:.unshift(lib_path)

require 'toy'

Adapter.define(:memory) do
  def read(key)
    deserialize(client[key_for(key)])
  end

  def write(key, value)
    client[key_for(key)] = serialize(value)
  end

  def delete(key)
    client.delete(key_for(key))
  end

  def clear
    client.clear
  end
end

class User
  include Toy::Store
  store :memory, {}
end

class LintTest < ActiveModel::TestCase
  include ActiveModel::Lint::Tests

  def setup
    @model = User.new
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
toystore-0.8.3 test/lint_test.rb
toystore-0.8.2 test/lint_test.rb
toystore-0.8.1 test/lint_test.rb
toystore-0.8.0 test/lint_test.rb
toystore-0.7.0 test/lint_test.rb
toystore-0.6.6 test/lint_test.rb
toystore-0.6.5 test/lint_test.rb
toystore-0.6.4 test/lint_test.rb
toystore-0.6.3 test/lint_test.rb
toystore-0.6.2 test/lint_test.rb
toystore-0.6.1 test/lint_test.rb
toystore-0.6 test/lint_test.rb
toystore-0.5 test/lint_test.rb