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.3.23 spec/helper_classes.rb
fossil-0.3.22 spec/helper_classes.rb
fossil-0.3.21 spec/helper_classes.rb
fossil-0.3.20 spec/helper_classes.rb
fossil-0.3.19 spec/helper_classes.rb
fossil-0.3.18 spec/helper_classes.rb
fossil-0.3.17 spec/helper_classes.rb
fossil-0.3.16 spec/helper_classes.rb
fossil-0.3.15 spec/helper_classes.rb
fossil-0.3.14 spec/helper_classes.rb
fossil-0.3.13 spec/helper_classes.rb
fossil-0.3.12 spec/helper_classes.rb
fossil-0.3.11 spec/helper_classes.rb
fossil-0.3.10 spec/helper_classes.rb
fossil-0.3.9 spec/helper_classes.rb
fossil-0.3.8 spec/helper_classes.rb
fossil-0.3.7 spec/helper_classes.rb
fossil-0.3.6 spec/helper_classes.rb
fossil-0.3.5 spec/helper_classes.rb
fossil-0.3.4 spec/helper_classes.rb