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