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.50 spec/helper_classes.rb
fossil-0.5.49 spec/helper_classes.rb
fossil-0.5.48 spec/helper_classes.rb
fossil-0.5.47 spec/helper_classes.rb
fossil-0.5.46 spec/helper_classes.rb
fossil-0.5.45 spec/helper_classes.rb
fossil-0.5.44 spec/helper_classes.rb
fossil-0.5.43 spec/helper_classes.rb
fossil-0.5.42 spec/helper_classes.rb
fossil-0.5.41 spec/helper_classes.rb
fossil-0.5.40 spec/helper_classes.rb
fossil-0.5.39 spec/helper_classes.rb
fossil-0.5.38 spec/helper_classes.rb
fossil-0.5.37 spec/helper_classes.rb
fossil-0.5.36 spec/helper_classes.rb
fossil-0.5.35 spec/helper_classes.rb
fossil-0.5.34 spec/helper_classes.rb
fossil-0.5.33 spec/helper_classes.rb
fossil-0.5.32 spec/helper_classes.rb
fossil-0.5.31 spec/helper_classes.rb