Sha256: 6b36401f362f9968ba8d60290df6944933e86c0d3bceab4b3c604ff9204a9d18

Contents?: true

Size: 669 Bytes

Versions: 132

Compression:

Stored size: 669 Bytes

Contents

class MockDataset < Sequel::Dataset
  def insert(*args); end
  def insert_select(*args); end
  def update(*args); end
  def fetch_rows(sql); end
  def quoted_identifier(c); end
end

class MockDatabase < Sequel::Database
  def execute(sql, opts={}); end
  def reset; end
  def transaction(opts={}); end
  def dataset; MockDataset.new(self); end
end

MOCK_DB = MockDatabase.new unless defined?(MOCK_DB)

class MockModel < Sequel::Model(MOCK_DB)
  def initialize(values)
    @values = values
  end
  def respond_to?(m)
    @values.has_key?(m)
  end
  def method_missing(m, *args, &block)
    return @values[m] if @values.has_key?(m)
    super(m, *args, &block)
  end
end

Version data entries

132 entries across 132 versions & 1 rubygems

Version Path
fossil-0.5.30 spec/helper_classes.rb
fossil-0.5.29 spec/helper_classes.rb
fossil-0.5.28 spec/helper_classes.rb
fossil-0.5.27 spec/helper_classes.rb
fossil-0.5.26 spec/helper_classes.rb
fossil-0.5.25 spec/helper_classes.rb
fossil-0.5.24 spec/helper_classes.rb
fossil-0.5.23 spec/helper_classes.rb
fossil-0.5.22 spec/helper_classes.rb
fossil-0.5.21 spec/helper_classes.rb
fossil-0.5.20 spec/helper_classes.rb
fossil-0.5.19 spec/helper_classes.rb
fossil-0.5.18 spec/helper_classes.rb
fossil-0.5.17 spec/helper_classes.rb
fossil-0.5.16 spec/helper_classes.rb
fossil-0.5.15 spec/helper_classes.rb
fossil-0.5.14 spec/helper_classes.rb
fossil-0.5.13 spec/helper_classes.rb
fossil-0.5.12 spec/helper_classes.rb
fossil-0.5.11 spec/helper_classes.rb