class Soar::Registry::Directory::Test::Provider::Stub

Public Instance Methods

duplicate_entry?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 73
def duplicate_entry?
  @error.is_a?(Soar::Registry::Directory::Error::DuplicateEntryError)
end
fetch_entry() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 65
def fetch_entry
  begin
    @entry = @directory.fetch(@@entry['uuid'])
  rescue Soar::Registry::Directory::Error::NoEntriesFoundError, Soar::Registry::Directory::Error::NetworkingError => e
    @error = e
  end
end
given_configured_directory() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 19
def given_configured_directory
  provider = Soar::Registry::Directory::Provider::Stub.new({
    table: "identities",
    index: @@index
  })
  @directory = Soar::Registry::Directory.new(provider)
end
given_existing_data() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 27
def given_existing_data
  @directory.put(@@entry)
end
index?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 85
def index?
  @index.is_a?(Array)
end
networking_error?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 101
def networking_error?
  @error.is_a?(Soar::Registry::Directory::Error::NetworkingError)
end
no_entries_found?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 93
def no_entries_found?
  @error.is_a?(Soar::Registry::Directory::Error::NoEntriesFoundError)
end
no_matching_entries?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 97
def no_matching_entries?
  @entry == []
end
persisted?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 77
def persisted?
  @@entry == @directory.fetch(@@entry["uuid"])
end
put_duplicate_entry() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 35
def put_duplicate_entry
  put_entry
end
put_entry() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 39
def put_entry
  begin
    @directory.put(@@entry)
  rescue Soar::Registry::Directory::Error::NetworkingError => e
    @error = e
  rescue Soar::Registry::Directory::Error::DuplicateEntryError => e
    @error = e
  end
end
request_index() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 57
def request_index
  begin
    @index = @directory.index
  rescue Soar::Registry::Directory::Error::NetworkingError => e
    @error = e
  end
end
returned?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 81
def returned?
  @entry == [@@entry]
end
sabotage_network() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 31
def sabotage_network
  @directory.provider.instance_variable_set(:@interface, Object.new)
end
search_for_entry() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 49
def search_for_entry
  begin
    @entry = @directory.search("identifier", @@entry['identifier'])
  rescue Soar::Registry::Directory::Error::NetworkingError => e
    @error = e
  end
end
single_entry?() click to toggle source
# File lib/soar/registry/directory/test/provider/stub.rb, line 89
def single_entry?
  @entry == @@entry
end