Sha256: d06e8b44ef201e133669f0062d3956735c01c0ca8ee799518c8f7b9d386a3841
Contents?: true
Size: 1.05 KB
Versions: 11
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require 'spec_helper' module Synvert describe Snippet do let(:snippets_path) { File.join(File.dirname(__FILE__), '.synvert') } let(:snippet) { Snippet.new(snippets_path) } after { FileUtils.rmdir(snippets_path) if File.exist?(snippets_path) } describe '.fetch_core_version' do it 'gets remote version' do stub_request(:get, 'https://rubygems.org/api/v1/versions/synvert-core.json').to_return( body: '[{"number":"0.4.2"}]' ) expect(Snippet.fetch_core_version).to eq '0.4.2' end end describe 'sync' do it 'git clones snippets' do expect(Kernel).to receive(:system).with( "git clone https://github.com/xinminlabs/synvert-snippets-ruby.git #{snippets_path}" ) snippet.sync end it 'git pull snippets' do FileUtils.mkdir snippets_path expect(Kernel).to receive(:system).with('git checkout .; git pull --rebase') snippet.sync FileUtils.cd File.dirname(__FILE__) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems