Sha256: 448bf7f7f3465c1a8e093b82f6b82ac83cba01a0c4ee68e2c48798cd441282a5
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
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( '{"json_class":"Ollama::Commands::Copy","source":"llama3.1","destination":"camell3","stream":false}' ) end it 'can perform' do copy = described_class.new(source: 'llama3.1', destination: 'camell3') copy.client = client = double('client') expect(client).to receive(:request).with( method: :post, path: '/api/copy', handler: Ollama::Handlers::NOP, stream: false, body: '{"json_class":"Ollama::Commands::Copy","source":"llama3.1","destination":"camell3","stream":false}' ) copy.perform(Ollama::Handlers::NOP) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ollama-ruby-0.0.0 | spec/ollama/commands/copy_spec.rb |