Sha256: 4261f784c09ed412c374212697f6087fb93d8e5ad49d5a39e17eb06a30620f1c

Contents?: true

Size: 961 Bytes

Versions: 16

Compression:

Stored size: 961 Bytes

Contents

require 'spec_helper'

RSpec.describe Ollama::Commands::Copy do
  it 'can be instantiated' do
    copy = described_class.new(source: 'llama3.1', destination: 'camell3')
    expect(copy).to be_a described_class
  end

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

  it 'can perform' do
    copy = described_class.new(source: 'llama3.1', destination: 'camell3')
    copy.client = ollama = double('Ollama::Client')
    expect(ollama).to receive(:request).with(
      method: :post, path: '/api/copy', handler: Ollama::Handlers::NOP, stream: false,
      body: '{"source":"llama3.1","destination":"camell3","stream":false}'
    )
    copy.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/copy_spec.rb
ollama-ruby-0.11.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.10.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.9.3 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.9.2 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.9.1 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.9.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.8.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.7.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.6.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.5.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.4.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.3.2 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.3.1 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.3.0 spec/ollama/commands/copy_spec.rb
ollama-ruby-0.2.0 spec/ollama/commands/copy_spec.rb