File tree Expand file tree Collapse file tree 5 files changed +28
-20
lines changed Expand file tree Collapse file tree 5 files changed +28
-20
lines changed Original file line number Diff line number Diff line change 3
3
# Live-reload integration tests
4
4
guard :rspec, cmd: 'bundle exec rspec --color --format progress' do
5
5
watch(%r{^spec/integration/.+_spec\.rb$})
6
+ watch('spec/integration/spec_helper.rb') { 'spec/integration' }
6
7
end
7
8
8
9
notification :off
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- require 'algoliasearch'
4
-
5
- SITE_PATH = File . expand_path ( './spec/site/_site' )
6
- RSpec ::Matchers . define :have_file do |expected |
7
- match do
8
- File . exist? ( File . join ( SITE_PATH , expected ) )
9
- end
10
- end
3
+ require_relative './spec_helper'
11
4
12
5
describe ( 'pushed index' ) do
13
6
before ( :all ) do
14
- Algolia . init (
15
- application_id : ENV [ 'ALGOLIA_APPLICATION_ID' ] ,
16
- api_key : ENV [ 'ALGOLIA_API_KEY' ]
17
- )
18
7
@index = Algolia ::Index . new ( ENV [ 'ALGOLIA_INDEX_NAME' ] )
19
8
end
20
9
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- require 'spec_helper'
4
- require 'algoliasearch'
5
- require 'awesome_print'
3
+ require_relative './spec_helper'
6
4
7
5
# Note: Those tests will delete and recreate the index several times, deleting
8
6
# any records in it, in order to test the settings.
16
14
let ( :indexer ) { Jekyll ::Algolia ::Indexer . init }
17
15
before ( :all ) do
18
16
# Requesting the index from outside of the Jekyll plugin
19
- Algolia . init (
20
- application_id : ENV [ 'ALGOLIA_APPLICATION_ID' ] ,
21
- api_key : ENV [ 'ALGOLIA_API_KEY' ]
22
- )
23
17
@index = Algolia ::Index . new ( ENV [ 'ALGOLIA_INDEX_NAME' ] )
24
18
25
19
# We keep a reference to what default index settings look like so we can
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'algoliasearch'
4
+ require 'awesome_print'
5
+ require 'jekyll'
6
+ require 'jekyll-algolia'
7
+
8
+ Algolia . init (
9
+ application_id : ENV [ 'ALGOLIA_APPLICATION_ID' ] ,
10
+ api_key : ENV [ 'ALGOLIA_API_KEY' ]
11
+ )
12
+
13
+ RSpec . configure do |config |
14
+ config . filter_run ( focus : true )
15
+ config . fail_fast = true
16
+ config . run_all_when_everything_filtered = true
17
+ end
18
+
19
+ SITE_PATH = File . expand_path ( './spec/site/_site' )
20
+ RSpec ::Matchers . define :have_file do |expected |
21
+ match do
22
+ File . exist? ( File . join ( SITE_PATH , expected ) )
23
+ end
24
+ end
Original file line number Diff line number Diff line change 188
188
stub_const ( 'ENV' , 'ALGOLIA_INDEX_NAME' => env_value )
189
189
end
190
190
191
- describe 'should return nil if none configured' do
191
+ describe 'should return the default value if none configured' do
192
192
let ( :env_value ) { nil }
193
193
let ( :config ) { { 'algolia' => { 'index_name' => nil } } }
194
194
it { should eq nil }
You can’t perform that action at this time.
0 commit comments