Sha256: f0498e38e111773a24f5cd236c4c192151eed3fe8896cc237b632c88a8b97d16

Contents?: true

Size: 962 Bytes

Versions: 1

Compression:

Stored size: 962 Bytes

Contents

# frozen_string_literal: true

# This file is part of Alexandria.
#
# See the file README.md for authorship and licensing information.

require_relative "../../spec_helper"

describe Alexandria::UI::ProviderPreferencesDialog do
  let(:parent) { Gtk::Window.new :toplevel }
  let(:preferences) do
    instance_double(Alexandria::BookProviders::Preferences,
                    length: 0, read: [])
  end
  let(:provider) do
    instance_double(Alexandria::BookProviders::GenericProvider,
                    fullname: "FooProvider",
                    prefs: preferences)
  end

  it "can be instantiated" do
    expect { described_class.new parent, provider }.not_to raise_error
  end

  describe "#acquire" do
    it "works" do
      preferences_dialog = described_class.new parent, provider
      gtk_dialog = preferences_dialog.dialog
      allow(gtk_dialog).to receive(:run)

      expect { preferences_dialog.acquire }.not_to raise_error
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alexandria-book-collection-manager-0.7.10 spec/alexandria/ui/provider_preferences_dialog_spec.rb