Sha256: 2b8d494b311d0f59ba36e0897b49b307a2b568c09ed8480a8301b961fcee7573

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

module MockHelpers

  def mock_default_window
    allow_any_instance_of(described_class).to receive(:default_window) { true }
  end

  def use_test_storage_file
    Belajar::Configuration.send(:new)
    Belajar.config.instance_variable_set(:@storage_file, local_storage_file)

    QuickStore.configure do |config|
      config.file_path = Belajar.config.storage_file
    end

    QuickStore.store.send(:new)
  end

  def suppress_print_out
    allow(described_class).to receive(:say_warning) {}
    allow(described_class).to receive(:say_info) {}
    allow(described_class).to receive(:say) {}
    allow($stdout).to receive(:puts) {}
    allow($stdout).to receive(:print) {}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
belajar-0.1.1 spec/support/macros/mock_helpers.rb