Sha256: 66f5a1fe7aeba0367188733d2897d1f6191e1f5a84db3d1d1f6a5bd869fb4e2d

Contents?: true

Size: 805 Bytes

Versions: 16

Compression:

Stored size: 805 Bytes

Contents

require 'spec_helper'

RSpec.describe Ollama::Commands::Show do
  it 'can be instantiated' do
    show = described_class.new(name: 'llama3.1')
    expect(show).to be_a described_class
  end

  it 'can be converted to JSON' do
    show = described_class.new(name: 'llama3.1')
    expect(show.as_json).to include(
      name: 'llama3.1', stream: false
    )
    expect(show.to_json).to eq(
      '{"name":"llama3.1","stream":false}'
    )
  end

  it 'can perform' do
    show = described_class.new(name: 'llama3.1')
    show.client = ollama = double('Ollama::Client')
    expect(ollama).to receive(:request).with(
      method: :post, path: '/api/show', handler: Ollama::Handlers::NOP ,stream: false,
      body: '{"name":"llama3.1","stream":false}'
    )
    show.perform(Ollama::Handlers::NOP)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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