Sha256: b6ae8500bda9cd1b5ffe653fcb101a94fe97de7a281a9e4680525da383db64c2

Contents?: true

Size: 827 Bytes

Versions: 17

Compression:

Stored size: 827 Bytes

Contents

require 'spec_helper'

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

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

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

Version data entries

17 entries across 17 versions & 1 rubygems

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