skellington 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8933464d9022bb8f8088ccea68f747a5b5aecc3c
4
- data.tar.gz: 4a4de0f2e138908875e2e198b7fdd8513e0ba7bb
3
+ metadata.gz: f235cc13c4aee809b69d238b567910174a9e4a52
4
+ data.tar.gz: 7f57088c57f77afab65fa099ccf929596b4cebcd
5
5
  SHA512:
6
- metadata.gz: dcdf3989813d5e730b1c35370228f53b5bfdc3c22c0f88d64a278d2e2fc5c05b3021177643a317664f76a20f607c89fb25fc85fcfbabfc230ba351952658aadb
7
- data.tar.gz: fc2dcd12df1b45c6d5ea7a182af6119d757abbc9e01206af3dd32da0b0099dfe36364a0972b69b38847f67f896bc9ca27aa544cbe6d3af755b5e761cc5cd4919
6
+ metadata.gz: 48ad41857da93100b3d9cf3b373eff1a2a547da5238af5703590c2185dafcd58d5a288f96b88991e494b006f6598c2adca83fa707ed647496a12f897b19c71ec
7
+ data.tar.gz: 006a2affeb86b2b5cdc894dcc914f19f919603fffe0e5771338cf67506f6ce08497eebe096247f93c9e1f5dad8343993c7f2f16c61a014e7514fdd7646286d09
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  # Skellington
10
10
 
11
- Generate a [Sinatra](http://www.sinatrarb.com/) app skeleton. Sets up
11
+ Extremely opinionated generator for your [Sinatra](http://www.sinatrarb.com/) app. Sets up:
12
12
 
13
13
  * [Cucumber](https://cucumber.io/)
14
14
  * with [cucumber-api-steps](https://github.com/jayzes/cucumber-api-steps)
@@ -1,3 +1,3 @@
1
1
  module Skellington
2
- VERSION = "0.4.3"
2
+ VERSION = '0.4.4'
3
3
  end
data/skellington.gemspec CHANGED
@@ -27,4 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rake', '~> 10.0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.1'
29
29
  spec.add_development_dependency 'guard-rspec', '~> 4.5'
30
+ spec.add_development_dependency 'curacao', '~> 0.1'
30
31
  end
@@ -5,7 +5,8 @@ module Skellington
5
5
  end
6
6
 
7
7
  it 'generates some cucumber file' do
8
- subject.generate 'dummy_app'
8
+ expect { subject.generate 'dummy_app' }.to produce_file 'dummy_app/features/step_definitions/dummy_app_steps.rb'
9
+
9
10
  expect('dummy_app/features/dummy_app.feature').to have_content (
10
11
  """
11
12
  Feature: Make sure DummyApp is plumbed in correctly
@@ -59,8 +60,6 @@ module Skellington
59
60
  end
60
61
  """
61
62
  )
62
-
63
- expect(File).to exist 'dummy_app/features/step_definitions/dummy_app_steps.rb'
64
63
  end
65
64
  end
66
65
  end
@@ -5,7 +5,8 @@ module Skellington
5
5
  end
6
6
 
7
7
  it 'generates javascript files' do
8
- subject.generate 'dummy_app'
8
+ expect{ subject.generate 'dummy_app'}.to produce_file 'dummy_app/spec/javascripts/support/jasmine_helper.rb'
9
+
9
10
  expect('dummy_app/spec/javascripts/support/jasmine.yml').to have_content (
10
11
  """
11
12
  src_files:
@@ -26,8 +27,6 @@ module Skellington
26
27
  """
27
28
  )
28
29
 
29
- expect(File).to exist 'dummy_app/spec/javascripts/support/jasmine_helper.rb'
30
-
31
30
  expect('dummy_app/spec/javascripts/dummy_app_spec.js').to have_content (
32
31
  """
33
32
  describe('DummyApp', function() {
@@ -5,10 +5,9 @@ module Skellington
5
5
  end
6
6
 
7
7
  it 'generates placeholders for static files' do
8
- subject.generate 'dummy_app'
9
- expect(File).to exist 'dummy_app/public/css/styles.css'
8
+ expect { subject.generate 'dummy_app' }.to produce_file 'dummy_app/public/css/styles.css'
10
9
  expect(File).to exist 'dummy_app/public/js/dummy_app.js'
11
- expect(File).to exist 'dummy_app/public/assets/favicon.ico'
10
+ expect(File).to exist 'dummy_app/public/assets/favicon.ico'
12
11
  end
13
12
  end
14
13
  end
@@ -5,8 +5,7 @@ module Skellington
5
5
  end
6
6
 
7
7
  it 'generates a .ruby-version' do
8
- subject.generate 'dummy_app'
9
- expect(File).to exist 'dummy_app/.ruby-version'
8
+ expect { subject.generate 'dummy_app' }.to produce_file 'dummy_app/.ruby-version'
10
9
  expect('dummy_app/.ruby-version').to have_content (
11
10
  """
12
11
  /[0-9]*\\.[0-9]*\\.[0-9]*/
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'skellington'
2
2
  require 'coveralls'
3
+ require 'curacao'
3
4
 
4
5
  Coveralls.wear_merged!
5
6
 
@@ -15,32 +16,4 @@ RSpec.configure do |config|
15
16
  config.filter_run :focus
16
17
  config.run_all_when_everything_filtered = true
17
18
  config.order = :random
18
-
19
- # Use tmp/ to write skellington
20
- $pwd = FileUtils.pwd
21
- config.before(:each) do
22
- FileUtils.rm_rf 'tmp'
23
- FileUtils.mkdir_p 'tmp'
24
- FileUtils.cd 'tmp'
25
- end
26
-
27
- config.after(:each) do
28
- FileUtils.cd $pwd
29
- end
30
-
31
- # Suppress CLI output. This *will* fuck with Pry
32
- original_stderr = $stderr
33
- original_stdout = $stdout
34
- config.before(:all) do
35
- # Redirect stderr and stdout
36
- $stderr = File.new '/dev/null', 'w'
37
- $stdout = File.new '/dev/null', 'w'
38
- end
39
-
40
- config.after(:all) do
41
- $stderr = original_stderr
42
- $stdout = original_stdout
43
- end
44
19
  end
45
-
46
- Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skellington
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '4.5'
125
+ - !ruby/object:Gem::Dependency
126
+ name: curacao
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.1'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.1'
125
139
  description: Generate tedious Cucumber and Sinatra boilerplate like a boss
126
140
  email:
127
141
  - sam@pikesley.org
@@ -191,10 +205,8 @@ files:
191
205
  - spec/cli/spec_spec.rb
192
206
  - spec/cli_spec.rb
193
207
  - spec/hyphens_spec.rb
194
- - spec/matcher/have_content_spec.rb
195
208
  - spec/skellington_spec.rb
196
209
  - spec/spec_helper.rb
197
- - spec/support/matchers/have_content.rb
198
210
  homepage: http://sam.pikesley.org/projects/skellington/
199
211
  licenses:
200
212
  - MIT
@@ -236,7 +248,5 @@ test_files:
236
248
  - spec/cli/spec_spec.rb
237
249
  - spec/cli_spec.rb
238
250
  - spec/hyphens_spec.rb
239
- - spec/matcher/have_content_spec.rb
240
251
  - spec/skellington_spec.rb
241
252
  - spec/spec_helper.rb
242
- - spec/support/matchers/have_content.rb
@@ -1,137 +0,0 @@
1
- describe 'Matcher' do
2
- context 'simple matches' do
3
- it 'matches a file and a string' do
4
- dump 'A string'
5
- expect('matcher').to have_content 'A string'
6
- end
7
-
8
- it 'matches two strings ignoring extra whitespace' do
9
- dump ' Leading space'
10
- expect('matcher').to have_content 'Leading space'
11
-
12
- dump 'Trailing space '
13
- expect('matcher').to have_content 'Trailing space'
14
-
15
- dump ' Space at both ends '
16
- expect('matcher').to have_content 'Space at both ends'
17
- end
18
-
19
- it 'does not match wrong strings' do
20
- dump 'A string'
21
- expect('matcher').to_not have_content 'A different string'
22
- end
23
- end
24
-
25
- context 'multi-line matches' do
26
- it 'matches on multi-line files' do
27
- dump """
28
- foo
29
- bar
30
- baz
31
- """
32
- expect('matcher').to have_content (
33
- """
34
- foo
35
- bar
36
- baz
37
- """
38
- )
39
- end
40
-
41
- it 'matches multi-line, ignoring extraneous whitespace' do
42
- dump """
43
- odd
44
- spacing
45
- here
46
- """
47
- expect('matcher').to have_content (
48
- """
49
- odd
50
- spacing
51
- here
52
- """
53
- )
54
- end
55
-
56
- it 'ignores blank lines' do
57
- dump """
58
-
59
- this
60
- has
61
- a blank
62
- """
63
- expect('matcher').to have_content (
64
- """
65
- this
66
- has
67
- a blank
68
- """
69
- )
70
- end
71
-
72
- it 'even blank lines in the middle of the file' do
73
- dump """
74
- this
75
- is
76
-
77
- a
78
- file
79
- """
80
- expect('matcher').to have_content (
81
- """
82
- this
83
- is
84
- a
85
- file
86
- """
87
- )
88
- end
89
- end
90
-
91
- context 'regular expressions' do
92
- it 'matches on a regex' do
93
- dump 'partial match'
94
- expect('matcher').to have_content '/partial/'
95
- end
96
-
97
- it 'matches on a regex somewhere in a file' do
98
- dump """
99
- source 'https://rubygems.org'
100
-
101
- ruby '2.3.0'
102
-
103
- gem 'skellington'
104
- """
105
- expect('matcher').to have_content (
106
- """
107
- source 'https://rubygems.org'
108
-
109
- /ruby '[0-9]*\.[0-9]*\.[0-9]*'/
110
-
111
- gem 'skellington'
112
- """
113
- )
114
- end
115
-
116
- it 'fails on a non-match' do
117
- dump """
118
- foo
119
- ruby '2.3.0'
120
- bar
121
- """
122
- expect('matcher').to_not have_content (
123
- """
124
- foo
125
- ruby 2.3.0
126
- bar
127
- """
128
- )
129
- end
130
- end
131
- end
132
-
133
- def dump content
134
- File.open 'matcher', 'w' do |f|
135
- f.write content
136
- end
137
- end
@@ -1,47 +0,0 @@
1
- RSpec::Matchers.define :have_content do |expected|
2
- match do |actual|
3
- actual = File.read actual
4
-
5
- pass = true
6
- expected.contentise.each_with_index do |line, index|
7
- unless line.matches actual.contentise[index]
8
- pass = false
9
- end
10
- end
11
- pass
12
- end
13
-
14
- failure_message do |actual|
15
- "expected #{expected} to match #{File.read actual}"
16
- end
17
-
18
- failure_message_when_negated do |actual|
19
- "expected #{expected} to not match #{File.read actual}"
20
- end
21
-
22
- description do
23
- 'matches file content against expectation'
24
- end
25
- end
26
-
27
- class String
28
- def contentise
29
- # split into lines, strip spaces from ends, ding blank lines
30
- self.strip.split("\n").map { |l| l.strip }.reject { |l| l == '' }
31
- end
32
-
33
- def matches other
34
- if self.is_regex
35
- return self.to_regex.match other
36
- end
37
- self == other
38
- end
39
-
40
- def is_regex
41
- /^\/.*\/$/.match self.strip
42
- end
43
-
44
- def to_regex
45
- Regexp.new self[1..-2]
46
- end
47
- end