Sha256: 3d861d9eb7e23a9bfba62efd7b304ac3c226e2af975166eefcf3c659b606a4ec

Contents?: true

Size: 780 Bytes

Versions: 18

Compression:

Stored size: 780 Bytes

Contents

require 'spec_helper'

RSpec.describe Ollama::Handlers::Progress do
  it 'has .to_proc' do
    expect_any_instance_of(described_class).to receive(:call).with(:foo)
    described_class.call(:foo)
  end

  it 'can display progress' do
    response = double('response', status: 'testing', completed: 23, total: 666, error: nil)
    expect(infobar.counter).to receive(:progress).with(by: 23).and_call_original
    expect(infobar.display).to receive(:update).and_call_original
    described_class.new.call(response)
  end

  it 'can display errors in progress' do
    response = double('response', error: 'foo', status: nil, completed: nil, total: nil)
    progress = described_class.new
    expect(infobar).to receive(:puts).with(/Error: .*foo/)
    progress.call(response)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ollama-ruby-0.12.1 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.12.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.11.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.10.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.9.3 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.9.2 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.9.1 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.9.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.8.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.7.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.6.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.5.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.4.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.3.2 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.3.1 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.3.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.2.0 spec/ollama/handlers/progress_spec.rb
ollama-ruby-0.1.0 spec/ollama/handlers/progress_spec.rb