skellington 0.8.9 → 0.9.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -0
- data/README.md +3 -9
- data/Rakefile +2 -32
- data/config/config.yaml +21 -7
- data/lib/skellington/cli.rb +0 -4
- data/lib/skellington/generator.rb +5 -14
- data/lib/skellington/helpers.rb +17 -0
- data/lib/skellington/version.rb +1 -1
- data/lib/skellington.rb +1 -1
- data/lib/templates/common/Gemfile +0 -6
- data/lib/templates/common/includes/footer +1 -1
- data/lib/templates/common/includes/header +1 -15
- data/lib/templates/common/includes/libs +14 -0
- data/lib/templates/common/includes/nav +11 -24
- data/lib/templates/common/sass/colours +12 -1
- data/lib/templates/common/sass/footer +2 -17
- data/lib/templates/jekyll/_data/libs.yml +1 -6
- data/lib/templates/{common/sass/styles → jekyll/css/styles.scss} +3 -4
- data/lib/templates/jekyll/post-run +1 -1
- data/lib/templates/sinatra/Rakefile +3 -2
- data/lib/templates/sinatra/post-run +1 -1
- data/lib/templates/sinatra/public/sass/styles.scss +13 -0
- data/lib/templates/sinatra/views/includes/js-libs.erb +7 -6
- data/skellington.gemspec +8 -9
- data/spec/hyphens_spec.rb +1 -1
- data/spec/jekyll/404_spec.rb +17 -15
- data/spec/jekyll/assets/static_spec.rb +9 -7
- data/spec/jekyll/bootstrap/css_spec.rb +111 -115
- data/spec/jekyll/cli_spec.rb +19 -8
- data/spec/jekyll/data/libs_spec.rb +31 -24
- data/spec/jekyll/git_spec.rb +15 -13
- data/spec/jekyll/index_md_spec.rb +15 -13
- data/spec/jekyll/js/javascript_spec.rb +9 -7
- data/spec/jekyll/layout/layout_spec.rb +108 -108
- data/spec/jekyll/root_files/code-of-conduct_spec.rb +17 -15
- data/spec/jekyll/root_files/config_yml_spec.rb +20 -18
- data/spec/jekyll/root_files/gemfile_spec.rb +16 -14
- data/spec/jekyll/root_files/license_spec.rb +61 -59
- data/spec/jekyll/root_files/rbenv_spec.rb +13 -11
- data/spec/jekyll/root_files/readme_spec.rb +13 -11
- data/spec/sinatra/app/app_spec.rb +46 -44
- data/spec/sinatra/app/config_yml_spec.rb +13 -11
- data/spec/sinatra/app/helpers_spec.rb +16 -14
- data/spec/sinatra/app/public_spec.rb +9 -7
- data/spec/sinatra/app/racks_spec.rb +33 -31
- data/spec/sinatra/bootstrap/css_spec.rb +133 -124
- data/spec/sinatra/cli_spec.rb +18 -16
- data/spec/sinatra/git_spec.rb +14 -12
- data/spec/sinatra/javascript/javascript_spec.rb +42 -40
- data/spec/sinatra/layout/includes_spec.rb +76 -58
- data/spec/sinatra/layout/layout_spec.rb +93 -104
- data/spec/sinatra/layout/views_spec.rb +22 -20
- data/spec/sinatra/root_files/code-of-conduct_spec.rb +16 -14
- data/spec/sinatra/root_files/config_ru_spec.rb +13 -11
- data/spec/sinatra/root_files/gemfile_spec.rb +30 -28
- data/spec/sinatra/root_files/guardfile_spec.rb +26 -24
- data/spec/sinatra/root_files/license_spec.rb +60 -58
- data/spec/sinatra/root_files/procfile_spec.rb +12 -10
- data/spec/sinatra/root_files/rakefile_spec.rb +30 -27
- data/spec/sinatra/root_files/rbenv_spec.rb +12 -10
- data/spec/sinatra/root_files/readme_spec.rb +12 -10
- data/spec/sinatra/spec/spec_spec.rb +71 -69
- data/spec/skellington_spec.rb +31 -2
- metadata +25 -47
- data/lib/templates/sinatra/config.rb +0 -4
- data/spec/jekyll/bootstrap_4/bootstrap_4_spec.rb +0 -54
- data/spec/sinatra/bootstrap_4/config_rb_bootstrap_4_spec.rb +0 -20
- data/spec/sinatra/bootstrap_4/gemfile_bootstrap_4_spec.rb +0 -39
- data/spec/sinatra/bootstrap_4/public_bootstrap_4_spec.rb +0 -35
- data/spec/sinatra/root_files/config_rb_spec.rb +0 -19
@@ -1,38 +1,40 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
it 'generates a Gemfile' do
|
9
|
+
subject.generate 'dummy-app'
|
10
|
+
expect('dummy_app/Gemfile').to have_content (
|
11
|
+
"""
|
12
|
+
source 'https://rubygems.org'
|
12
13
|
|
13
|
-
|
14
|
+
/ruby '[0-9]*\\.[0-9]*\\.[0-9]*'/
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
gem 'sinatra', '~> 1.4'
|
17
|
+
gem 'rack-conneg'
|
18
|
+
gem 'rack-tracker'
|
19
|
+
gem 'rake'
|
20
|
+
gem 'compass'
|
21
|
+
gem 'bootstrap'
|
22
|
+
gem 'erubis'
|
23
|
+
gem 'puma'
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
group :test do
|
26
|
+
gem 'rspec'
|
27
|
+
gem 'guard'
|
28
|
+
gem 'guard-rspec'
|
29
|
+
gem 'guard-jasmine'
|
30
|
+
gem 'coveralls'
|
31
|
+
gem 'jasmine'
|
32
|
+
gem 'pry'
|
33
|
+
gem 'actionpack'
|
34
|
+
end
|
35
|
+
"""
|
36
|
+
)
|
33
37
|
end
|
34
|
-
"""
|
35
|
-
)
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -1,34 +1,36 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
it 'generates a Guardfile' do
|
8
|
-
subject.generate 'dummy-app'
|
9
|
-
expect('dummy_app/Guardfile').to have_content (
|
10
|
-
"""
|
11
|
-
guard :jasmine do
|
12
|
-
/watch/
|
13
|
-
/watch/
|
14
|
-
/watch/
|
15
|
-
/watch/
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
16
6
|
end
|
17
7
|
|
18
|
-
|
19
|
-
|
20
|
-
|
8
|
+
it 'generates a Guardfile' do
|
9
|
+
subject.generate 'dummy-app'
|
10
|
+
expect('dummy_app/Guardfile').to have_content (
|
11
|
+
"""
|
12
|
+
guard :jasmine do
|
13
|
+
/watch/
|
14
|
+
/watch/
|
15
|
+
/watch/
|
16
|
+
/watch/
|
17
|
+
end
|
18
|
+
|
19
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
20
|
+
require 'guard/rspec/dsl'
|
21
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
rspec = dsl.rspec
|
24
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
25
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
26
|
+
watch(rspec.spec_files)
|
26
27
|
|
27
|
-
|
28
|
-
|
28
|
+
ruby = dsl.ruby
|
29
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
30
|
+
end
|
31
|
+
"""
|
32
|
+
)
|
29
33
|
end
|
30
|
-
"""
|
31
|
-
)
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
@@ -1,73 +1,75 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
context 'generate a LICENSE' do
|
9
|
+
it 'plain license' do
|
10
|
+
Timecop.freeze Time.local 2016, 01, 19
|
11
|
+
subject.generate 'dummy-app'
|
12
|
+
expect('dummy_app/LICENSE.md').to have_content (
|
13
|
+
"""
|
14
|
+
##Copyright (c) 2016 YOUR-NAME-HERE
|
14
15
|
|
15
|
-
|
16
|
+
#MIT License
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
19
|
+
a copy of this software and associated documentation files (the
|
20
|
+
'Software'), to deal in the Software without restriction, including
|
21
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
22
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
23
|
+
permit persons to whom the Software is furnished to do so, subject to
|
24
|
+
the following conditions:
|
24
25
|
|
25
|
-
|
26
|
-
|
26
|
+
The above copyright notice and this permission notice shall be
|
27
|
+
included in all copies or substantial portions of the Software.
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
30
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
31
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
32
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
33
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
34
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
35
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
36
|
+
"""
|
37
|
+
)
|
38
|
+
Timecop.return
|
39
|
+
end
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
it 'with a provided name' do
|
42
|
+
Timecop.freeze Time.local 2016, 01, 19
|
43
|
+
subject.options = {licensor: 'Beyoncé'}
|
44
|
+
subject.generate 'dummy-app'
|
45
|
+
expect('dummy_app/LICENSE.md').to have_content (
|
46
|
+
"""
|
47
|
+
##Copyright (c) 2016 Beyoncé
|
47
48
|
|
48
|
-
|
49
|
+
#MIT License
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
52
|
+
a copy of this software and associated documentation files (the
|
53
|
+
'Software'), to deal in the Software without restriction, including
|
54
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
55
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
56
|
+
permit persons to whom the Software is furnished to do so, subject to
|
57
|
+
the following conditions:
|
57
58
|
|
58
|
-
|
59
|
-
|
59
|
+
The above copyright notice and this permission notice shall be
|
60
|
+
included in all copies or substantial portions of the Software.
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
63
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
64
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
65
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
66
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
67
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
68
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
69
|
+
"""
|
70
|
+
)
|
71
|
+
Timecop.return
|
72
|
+
end
|
71
73
|
end
|
72
74
|
end
|
73
75
|
end
|
@@ -1,16 +1,18 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
it 'generates a Procfile' do
|
9
|
+
subject.generate 'dummy-app'
|
10
|
+
expect('dummy_app/Procfile').to have_content (
|
11
|
+
"""
|
12
|
+
web: bundle exec rackup -p $PORT
|
13
|
+
"""
|
14
|
+
)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,40 +1,43 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
it 'generates a Rakefile' do
|
9
|
+
subject.generate 'dummy-app'
|
10
|
+
expect('dummy_app/Rakefile').to have_content (
|
11
|
+
"""
|
12
|
+
require File.join(File.dirname(__FILE__), 'lib/dummy_app.rb')
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
unless ENV['RACK_ENV'] == 'production'
|
15
|
+
require 'rspec/core/rake_task'
|
16
|
+
require 'coveralls/rake/task'
|
17
|
+
require 'jasmine'
|
18
|
+
load 'jasmine/tasks/jasmine.rake'
|
18
19
|
|
19
|
-
|
20
|
-
|
20
|
+
RSpec::Core::RakeTask.new
|
21
|
+
Coveralls::RakeTask.new
|
21
22
|
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
namespace :run do
|
26
|
-
desc 'start app'
|
27
|
-
task :app do
|
28
|
-
sh 'rackup -o 0.0.0.0'
|
23
|
+
task :default => [:spec, 'jasmine:ci', 'coveralls:push']
|
29
24
|
end
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
namespace :run do
|
27
|
+
desc 'start app'
|
28
|
+
task :app do
|
29
|
+
sh 'rackup -o 0.0.0.0'
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'watch and compile sass'
|
33
|
+
task :sass do
|
34
|
+
sh 'sass --update --force public/sass:public/css'
|
35
|
+
sh 'sass --watch public/sass:public/css'
|
36
|
+
end
|
34
37
|
end
|
38
|
+
"""
|
39
|
+
)
|
35
40
|
end
|
36
|
-
"""
|
37
|
-
)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
@@ -1,16 +1,18 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
it 'generates a .ruby-version' do
|
9
|
+
expect { subject.generate 'dummy-app' }.to produce_file 'dummy_app/.ruby-version'
|
10
|
+
expect('dummy_app/.ruby-version').to have_content (
|
11
|
+
"""
|
12
|
+
/[0-9]*\\.[0-9]*\\.[0-9]*/
|
13
|
+
"""
|
14
|
+
)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,16 +1,18 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
it 'generates a README' do
|
9
|
+
subject.generate 'dummy-app'
|
10
|
+
expect('dummy_app/README.md').to have_content (
|
11
|
+
"""
|
12
|
+
# DummyApp
|
13
|
+
"""
|
14
|
+
)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,93 +1,95 @@
|
|
1
1
|
module Skellington
|
2
2
|
describe CLI do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
context 'sinatra' do
|
4
|
+
let :subject do
|
5
|
+
described_class.new
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
it 'generates rspec files' do
|
9
|
+
subject.generate 'dummy-app'
|
10
|
+
expect('dummy_app/spec/spec_helper.rb').to have_content (
|
11
|
+
"""
|
12
|
+
require 'coveralls'
|
13
|
+
Coveralls.wear_merged!
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
require 'rack/test'
|
16
|
+
require 'dummy_app'
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.expect_with :rspec do |expectations|
|
20
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
config.mock_with :rspec do |mocks|
|
24
|
+
mocks.verify_partial_doubles = true
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
+
config.order = :random
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
include Rack::Test::Methods
|
30
|
+
def app
|
31
|
+
DummyApp::App
|
32
|
+
end
|
31
33
|
end
|
32
|
-
|
33
|
-
|
34
|
-
)
|
34
|
+
"""
|
35
|
+
)
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
expect('dummy_app/spec/dummy_app/dummy_app_spec.rb').to have_content (
|
38
|
+
"""
|
39
|
+
module DummyApp
|
40
|
+
JSON_HEADERS = { 'HTTP_ACCEPT' => 'application/json' }
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
describe App do
|
43
|
+
it 'says hello' do
|
44
|
+
get '/'
|
45
|
+
expect(last_response).to be_ok
|
46
|
+
expect(last_response.body).to match /Hello from DummyApp/
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
49
|
+
it 'serves JSON' do
|
50
|
+
get '/', nil, JSON_HEADERS
|
51
|
+
expect(last_response).to be_ok
|
52
|
+
expect(JSON.parse last_response.body).to eq (
|
53
|
+
{
|
54
|
+
'app' => 'DummyApp'
|
55
|
+
}
|
56
|
+
)
|
57
|
+
end
|
56
58
|
end
|
57
59
|
end
|
58
|
-
|
59
|
-
|
60
|
-
)
|
60
|
+
"""
|
61
|
+
)
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
expect('dummy_app/spec/dummy_app/helpers_spec.rb').to have_content (
|
64
|
+
"""
|
65
|
+
class TestHelper
|
66
|
+
include DummyApp::Helpers
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
module DummyApp
|
70
|
+
describe Helpers do
|
71
|
+
let(:helpers) { TestHelper.new }
|
71
72
|
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
it 'says hello' do
|
74
|
+
expect(helpers.hello).to eq 'Hello'
|
75
|
+
end
|
75
76
|
|
76
|
-
|
77
|
-
|
77
|
+
it 'has a config' do
|
78
|
+
expect(CONFIG).to be_a Hash
|
79
|
+
end
|
78
80
|
end
|
79
81
|
end
|
80
|
-
|
81
|
-
|
82
|
-
)
|
82
|
+
"""
|
83
|
+
)
|
83
84
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
85
|
+
expect('dummy_app/.rspec').to have_content (
|
86
|
+
"""
|
87
|
+
--color
|
88
|
+
--require spec_helper
|
89
|
+
--format documentation
|
90
|
+
"""
|
91
|
+
)
|
92
|
+
end
|
91
93
|
end
|
92
94
|
end
|
93
95
|
end
|
data/spec/skellington_spec.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
1
|
module Skellington
|
4
2
|
describe Skellington do
|
5
3
|
it 'camelises a worm_case string' do
|
@@ -10,5 +8,36 @@ module Skellington
|
|
10
8
|
expect(Skellington.unslash './word').to eq 'word'
|
11
9
|
expect(Skellington.unslash 'another_word').to eq 'another_word'
|
12
10
|
end
|
11
|
+
|
12
|
+
it 'generates a JS lib import line for Sinatra' do
|
13
|
+
data = YAML.load("""
|
14
|
+
- name: bootstrap
|
15
|
+
url: //maxcdn.bootstrapcdn.com/bootstrap/VERSION/js/bootstrap.min.js
|
16
|
+
version: 4.0.0
|
17
|
+
hash: sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl
|
18
|
+
""")[0]
|
19
|
+
|
20
|
+
expect(Skellington.js_for_sinatra data).to eq (
|
21
|
+
""" bootstrap: {
|
22
|
+
url: '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js',
|
23
|
+
hash: 'sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl'
|
24
|
+
}"""
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'generates a JS lib import line for Jekyll' do
|
29
|
+
data = YAML.load("""
|
30
|
+
- name: bootstrap
|
31
|
+
url: //maxcdn.bootstrapcdn.com/bootstrap/VERSION/js/bootstrap.min.js
|
32
|
+
version: 4.0.0
|
33
|
+
hash: sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl
|
34
|
+
""")[0]
|
35
|
+
|
36
|
+
expect(Skellington.js_for_jekyll data).to eq (
|
37
|
+
""" - name: bootstrap
|
38
|
+
url: //maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js
|
39
|
+
hash: sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"""
|
40
|
+
)
|
41
|
+
end
|
13
42
|
end
|
14
43
|
end
|