Move previous lib and spec to _old directories
This commit is contained in:
parent
50e2513081
commit
f15ac944b6
4
Rakefile
4
Rakefile
@ -22,6 +22,10 @@ RSpec::Core::RakeTask.new(:test_details) do |spec|
|
||||
spec.rspec_opts = '--color --format documentation'
|
||||
spec.pattern = FileList['spec/*_spec.rb']
|
||||
end
|
||||
desc 'Run tests in all Ruby versions (with full details)'
|
||||
RSpec::Core::RakeTask.new(:test_all_ruby_versions) do
|
||||
sh './scripts/test_all_ruby_versions'
|
||||
end
|
||||
|
||||
# WATCH
|
||||
desc 'Watch for changes in files and reload tests'
|
||||
|
||||
30
jeremy.rb
Normal file
30
jeremy.rb
Normal file
@ -0,0 +1,30 @@
|
||||
module AlgoliaPlugin
|
||||
def self.do_something(config)
|
||||
site = Jekyll::Site.new(config)
|
||||
site.process
|
||||
end
|
||||
end
|
||||
|
||||
describe 'AlgoliaPlugin' do
|
||||
it 'should create a new site with the config passed' do
|
||||
# Given
|
||||
config = { foo: 'bar' }
|
||||
|
||||
# When
|
||||
AlgoliaPlugin.do_something(config)
|
||||
|
||||
# Then
|
||||
# ???
|
||||
# expect(Jekyll::Site).to receive(:new).with(input) <= Does not work because
|
||||
# I haven't allowed listening to it
|
||||
#
|
||||
# mock_site = double('Jekyll::Site', process: nil)
|
||||
# allow(Jekyll::Site).to receive(:new).and_return(mock_site) <= Ok, I can
|
||||
# call the method without failing but the expect does not work
|
||||
#
|
||||
# Only thing that works is writing the full expect (including
|
||||
# with/and_return) from the start, but that has me writing my expectation at
|
||||
# the beginning...
|
||||
#
|
||||
end
|
||||
end
|
||||
@ -1,13 +1,19 @@
|
||||
require 'jekyll/commands/algolia'
|
||||
|
||||
module Jekyll
|
||||
# Main Algolia module entrypoint
|
||||
# Requirable file, loading all dependencies.
|
||||
# Methods here are called by the main `jekyll algolia` command
|
||||
module Algolia
|
||||
# Holds the current plugin version
|
||||
require 'jekyll/algolia/version'
|
||||
# Extracts records from Jekyll files
|
||||
require 'jekyll/algolia/extractor'
|
||||
# Read configuration options
|
||||
require 'jekyll/algolia/configurator'
|
||||
# Push records to Algolia
|
||||
require 'jekyll/algolia/indexer'
|
||||
|
||||
|
||||
# Public: Init the Algolia module
|
||||
#
|
||||
# config - A hash of Jekyll config option (merge of _config.yml options and
|
||||
@ -67,4 +73,3 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -9,12 +9,12 @@ for version in "${versions[@]}"; do
|
||||
# Install this ruby version if not yet installed
|
||||
if [[ "$installed_version" != *"$version"* ]]; then
|
||||
echo "$version not found, installing it"
|
||||
rvm install $version
|
||||
rvm install "$version"
|
||||
fi
|
||||
|
||||
echo "Updating dependencies"
|
||||
rvm $version exec bundle install
|
||||
rvm "$version" exec bundle install
|
||||
|
||||
echo "Running tests"
|
||||
rvm $version exec bundle exec rake test
|
||||
rvm "$version" exec bundle exec rake test_details
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user