release_notes 0.5.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4b4a4e8bf933a1dfd39666d985d945b745ac7d7
4
- data.tar.gz: 42b99ef88c751918ff5e18c1dd69e78f76fb5be5
3
+ metadata.gz: 5ebff1dc3ba451c2edfed2a67328825c11ece400
4
+ data.tar.gz: d202b99c8ad32195bad01bb6f0d94179ac7614fc
5
5
  SHA512:
6
- metadata.gz: 791430ac706055a30a97808aead68464764a50f644003a2f14447138324e1fd58d2d10378dfb971ea430ce2b38ff4b2463398a4cf38266c651f84866f4e667c7
7
- data.tar.gz: 3c2f58bb077552783015e5822d8bd2fe33dc8244f1497e743a97b5acd187008bef7fe268152033b3d5439d13176160bd1673fa58c4e5ed255cba3883768cc441
6
+ metadata.gz: c1f6c8bf9b12f22fbc74a597740c031d862e42c3c3131de3f6c4b2e3bdad2c18b0ce6981059803ee3b3c1fb29d425154f3d18a41c3a63fe34244753a810ace0b
7
+ data.tar.gz: 77e4ca2480fe549a1986c0459f0c57d8a82252d011815546eb83ac7e24d65c5c047dc8eea4288defce4b4f911d8e4c7e1768ede098ce86cd38934a37f1374b2c
@@ -0,0 +1,101 @@
1
+ Feature: Cli
2
+ In order to run ReleaseNotes from the command line
3
+ Cli commands must run properly
4
+
5
+ Background:
6
+ Given a Rails app named "hello_world" exists
7
+ And this gem "release_notes" is installed in the app
8
+ And this gem is ready to use
9
+
10
+
11
+ Scenario: Generate a new release note
12
+ Given I am in "tmp/hello_world"
13
+ And I run `release_notes new`
14
+ Then a directory named "release_notes" should exist
15
+ And a file matching %r<[0-9]*_0_1_0.md$> should exist
16
+
17
+
18
+ Scenario: Save a release note to the database
19
+ Given I am in "tmp/hello_world"
20
+ And I run `release_notes new`
21
+ Then a model named "ReleaseNote" should have "0" records
22
+
23
+ And I run `release_notes update`
24
+ Then a model named "ReleaseNote" should have "1" records
25
+
26
+
27
+ Scenario: Generate release note to a specific destination
28
+ Given I am in "tmp/hello_world"
29
+ And I run `release_notes new -d="whatwhat"`
30
+ Then a directory named "whatwhat" should exist
31
+ And a directory named "release_notes" should not exist
32
+ And a file matching %r<[0-9]*_0_1_0.md$> should exist
33
+
34
+
35
+ Scenario: Overwrite a previous release note
36
+ Given I am in "tmp/hello_world"
37
+ And I run `release_notes new`
38
+ And I run `release_notes new -v=0.1.0 -f`
39
+ Then a file matching %r<[0-9]*_0_1_0.md$> should exist
40
+
41
+
42
+ Scenario: Generate release notes in increments
43
+ Given I am in "tmp/hello_world"
44
+ And I run `release_notes new`
45
+ And I run `release_notes new -i=m`
46
+ Then a file matching %r<[0-9]*_0_2_0.md$> should exist
47
+
48
+ And I run `release_notes new -i=M`
49
+ Then a file matching %r<[0-9]*_1_0_0.md$> should exist
50
+
51
+ And I run `release_notes new -i=major`
52
+ Then a file matching %r<[0-9]*_2_0_0.md$> should exist
53
+
54
+ And I run `release_notes new -i=minor`
55
+ Then a file matching %r<[0-9]*_2_1_0.md$> should exist
56
+
57
+ And I run `release_notes new`
58
+ Then a file matching %r<[0-9]*_2_1_1.md$> should exist
59
+
60
+ And I run `release_notes update`
61
+ Then a model named "ReleaseNote" should have "6" records
62
+
63
+
64
+ Scenario: Runs ReleaseNotes interatively
65
+ Given I am in "tmp/hello_world"
66
+ When I run `release_notes new -m` interactively
67
+ And I type "a: This is a test!"
68
+ And I type "done"
69
+ And I type "Some summary statement..."
70
+ Then a directory named "release_notes" should exist
71
+ And a file matching "/release_notes/[0-9]*_0_1_0.md" should contain "Some summary statement..."
72
+
73
+
74
+ Scenario: Update release notes in a specific directory
75
+ Given I am in "tmp/hello_world"
76
+ And I run `release_notes new`
77
+ And I run `release_notes new`
78
+ And I run `release_notes new -d=oye`
79
+ And I run `release_notes new -d=oye`
80
+ And I run `release_notes new -d=oye`
81
+ And I run `release_notes update -d=oye`
82
+ Then a model named "ReleaseNote" should have "3" records
83
+
84
+
85
+ Scenario: Use the given version
86
+ Given I am in "tmp/hello_world"
87
+ And I run `release_notes new -v=1.2.3`
88
+ Then a file matching %r<[0-9]*_1_2_3.md$> should exist
89
+
90
+
91
+ Scenario: Update release notes without creating a log
92
+ Given I am in "tmp/hello_world"
93
+ And I run `release_notes new`
94
+ And I run `release_notes update -n`
95
+ Then the file "release_notes/README.md" should not exist
96
+
97
+
98
+ Scenario: Returns the version of ReleaseNotes
99
+ Given I am in "tmp/hello_world"
100
+ When I run `release_notes -v`
101
+ Then the output from "release_notes -v" should contain "ReleaseNotes v"
@@ -0,0 +1,20 @@
1
+ Feature: Generators
2
+ In order to run ReleaseNotes properly
3
+ Generators must run properly
4
+
5
+ Background:
6
+ Given a Rails app named "hello_world" exists
7
+ And this gem "release_notes" is installed in the app
8
+
9
+
10
+ Scenario: Generate ReleaseNotes initializer
11
+ Given I am in "tmp/hello_world"
12
+ When I run `rails generate release_notes:install`
13
+ Then the file "config/initializers/release_notes.rb" should exist
14
+
15
+
16
+ Scenario: Generate ReleaseNote migration
17
+ Given I am in "tmp/hello_world"
18
+ When I run `rails generate release_notes ReleaseNote`
19
+ Then a file matching %r<[0-9]*_release_notes_create_release_notes.rb$> should exist
20
+ And the file "config/routes.rb" should contain "mount ReleaseNotes::Engine, at: '/release_notes', :as => 'release_notes'"
@@ -0,0 +1,122 @@
1
+ # Creates an app and sets the RAILS_ROOT and navigates to that app's root
2
+ Given /^a Rails app named "([^\"]*)" exists$/ do |app_name|
3
+ @app_name = app_name
4
+ step "I successfully run `rm -rf #{app_name}`" # ensure working directory is clean
5
+ step "a directory named \"#{app_name}\" should not exist"
6
+ step "I successfully run `rails new #{app_name}`"
7
+
8
+ ENV["RAILS_ENV"] ||= "test"
9
+ require File.expand_path("../../../tmp/hello_world/config/environment.rb", __FILE__)
10
+ ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "/tmp/hello_world"
11
+
12
+ step "I cd to \"#{app_name}\""
13
+ end
14
+
15
+ When /^this gem "([^\"]*)" is installed in the app$/ do |gem_name|
16
+ gem_path = File.expand_path('../../../', __FILE__)
17
+ step "I append to \"Gemfile\" with \"gem '#{gem_name}', :path => '#{gem_path}'\""
18
+ step "I successfully run `bundle check`"
19
+ end
20
+
21
+ When /^this gem is ready to use$/ do
22
+ ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => 'db/test.sqlite3')
23
+
24
+ step "I run `rails generate release_notes:install`"
25
+ step "I run `rails generate release_notes ReleaseNote`"
26
+ step "I run `rake db:migrate`"
27
+ end
28
+
29
+ Then /^a file matching "([^\"]*)" should contain "([^\"]*)"$/ do |simple_regex, partial_content|
30
+ file = Dir[[@basedir, simple_regex].join][0]
31
+ file.slice! @basedir + '/'
32
+ check_file_content(file, partial_content, true)
33
+ end
34
+
35
+ Then /^a model named "([^\"]*)" should have "([0-9]+)" records$/ do |model_name, record_count|
36
+ expect(model_name.constantize.count).to eq(record_count.to_i)
37
+ end
38
+
39
+ Given /^I am in "([^\"]*)"$/ do |directory|
40
+ @basedir = directory
41
+ end
42
+
43
+ Given /^the file "([^\"]*)" exists$/ do |filename|
44
+ expect(File.exists?(File.join(@basedir, filename))).to eq(true)
45
+ end
46
+
47
+ When /^I copy the file "([^\"]*)" to "([^\"]*)"$/ do |src, dest|
48
+ FileUtils.cp(File.join(@basedir, src), File.join(@basedir, dest))
49
+ end
50
+
51
+ Then /^the file "([^\"]*)" should exist$/ do |filename|
52
+ expect(File.exists?(File.join(@basedir, filename))).to eq(true)
53
+ end
54
+
55
+ Given /^the following files exist:$/ do |table|
56
+ (@files_i_care_about || table.hashes).each do |file|
57
+ expect(File.exists?(File.join(@basedir, file["filename"]))).to eq(true)
58
+ end
59
+ end
60
+
61
+ When /^I copy the following files to "([^\"]*)":$/ do |destination, table|
62
+ table.hashes.each do |file|
63
+ filename = File.join(@basedir, file["filename"])
64
+ FileUtils.cp(filename, destination)
65
+ end
66
+ end
67
+
68
+ Then /^the following files should exist in "([^\"]*)":$/ do |destination, table|
69
+ table.hashes.each do |file|
70
+ expect(File.exists?(File.join(destination, file["filename"]))).to eq(true)
71
+ end
72
+ end
73
+
74
+ When /^I create the directory "([^\"]*)"$/ do |directory|
75
+ FileUtils.mkdir_p(directory).should_not be_nil
76
+ end
77
+
78
+ Given /^the following table of (.+):$/ do |name, table|
79
+ @tables = {}
80
+ @tables[name] = table.hashes
81
+ end
82
+
83
+ When /^I copy the (.+) in the table to "([^\"]*)"$/ do |name, destination|
84
+ @tables[name].each do |file|
85
+ filename = File.join(@basedir, file["filename"])
86
+ FileUtils.cp(filename, destination)
87
+ end
88
+ end
89
+
90
+ Then /^the (.+) in the table should exist in "([^\"]*)"$/ do |name, destination|
91
+ @tables[name].each do |file|
92
+ expect(File.exists?(File.join(destination, file["filename"]))).to eq(true)
93
+ end
94
+ end
95
+
96
+ When /^I copy files beginning with the letters (\S+) to "([^\"]*)"$/ do |pattern, destination|
97
+ patterns = pattern.split(',')
98
+ @filelist = []
99
+ @destination = destination
100
+ patterns.each do |pattern|
101
+ glob = Dir.glob(File.join(@basedir, "#{pattern}*"))
102
+
103
+ actual_files = glob.find_all do |filename|
104
+ File.file?(filename)
105
+ end
106
+
107
+ @filelist << actual_files.map do |filename|
108
+ File.basename(filename)
109
+ end
110
+ end
111
+ @filelist.flatten!
112
+ @filelist.each do |filename|
113
+ FileUtils.cp(File.join(@basedir, filename), @destination)
114
+ end
115
+ end
116
+
117
+ Then /^they should exist there$/ do
118
+ raise unless @filelist && @destination
119
+ @filelist.each do |filename|
120
+ expect(File.exists?(File.join(@destination, filename))).to eq(true)
121
+ end
122
+ end
@@ -1 +1,8 @@
1
- require 'aruba/cucumber'
1
+ require 'aruba/cucumber'
2
+ require 'pry'
3
+ require 'rails'
4
+
5
+ Before do
6
+ @aruba_timeout_seconds = 20
7
+ @dirs = ["tmp"]
8
+ end
@@ -111,7 +111,7 @@ module ReleaseNotes
111
111
  desc 'version', 'Show version of release_notes'
112
112
 
113
113
  def version
114
- puts "ReleaseNotes #{ReleaseNotes::VERSION}"
114
+ puts "ReleaseNotes v#{ReleaseNotes::VERSION}"
115
115
  end
116
116
 
117
117
 
@@ -1,3 +1,3 @@
1
1
  module ReleaseNotes
2
- VERSION = "0.5.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency "bootstrap-sass", "~> 3.2.0"
26
26
  spec.add_dependency "redcarpet", "~> 3.0.0"
27
27
 
28
+ spec.add_development_dependency "pry-rails"
28
29
  spec.add_development_dependency "rspec-rails", "~> 3.0.0"
29
30
  spec.add_development_dependency "factory_girl_rails", "~> 4.4.1"
31
+ spec.add_development_dependency "aruba", "~> 0.6.0"
30
32
  spec.add_development_dependency "sqlite3"
31
33
  end
@@ -48,7 +48,7 @@ module ReleaseNotes
48
48
  it "assigns @release_notes" do
49
49
  get :show, { version: @release_note.version, use_route: :release_notes }
50
50
 
51
- expect(assigns(:release_notes)).to eq(@release_note)
51
+ expect(assigns(:release_notes)).to eq([@release_note])
52
52
  end
53
53
  end
54
54
  end
@@ -0,0 +1,17 @@
1
+ # Demo App 1.0.0 Release Notes
2
+ ###### Full test coverage, I think...
3
+
4
+ #### 07/15/2014
5
+
6
+ Additions
7
+ ----
8
+ * Added Cucumber generator tests.
9
+ * Added Cucumber CLI tests.
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ *the end*
@@ -1,3 +1,51 @@
1
+ # Demo App 1.0.0 Release Notes
2
+ ###### Full test coverage, I think...
3
+
4
+ #### 07/15/2014
5
+
6
+ Additions
7
+ ----
8
+ * Added Cucumber generator tests.
9
+ * Added Cucumber CLI tests.
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ *the end*
18
+
19
+ ---
20
+
21
+ # Demo App 0.5.1 Release Notes
22
+ ###### Added release_note_indicator helper.
23
+
24
+ #### 07/13/2014
25
+
26
+ Additions
27
+ ----
28
+ * Added release_note_indicator helper.
29
+ * Added release_note_indicator snippet to dummy app view.
30
+
31
+ Changes
32
+ ----
33
+ * Updated gemspec.
34
+ * Updated README.
35
+
36
+ Fixes
37
+ ----
38
+ * Fixed a template error that occurred when trying to navigate to a specific release note by version.
39
+
40
+ Upcoming
41
+ ----
42
+ * Add generator tests.
43
+ * Add command line tests.
44
+
45
+ *the end*
46
+
47
+ ---
48
+
1
49
  # Demo App 0.5.1 Release Notes
2
50
  ###### Added release_note_indicator helper.
3
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: release_notes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Robins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-13 00:00:00.000000000 Z
11
+ date: 2014-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.0.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec-rails
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +122,20 @@ dependencies:
108
122
  - - ~>
109
123
  - !ruby/object:Gem::Version
110
124
  version: 4.4.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: aruba
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: 0.6.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 0.6.0
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: sqlite3
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +160,6 @@ extra_rdoc_files: []
132
160
  files:
133
161
  - .gitignore
134
162
  - .rspec
135
- - .ruby-version
136
163
  - Gemfile
137
164
  - LICENSE.txt
138
165
  - README.md
@@ -149,6 +176,9 @@ files:
149
176
  - app/views/release_notes/release_notes/show.html.erb
150
177
  - bin/release_notes
151
178
  - config/routes.rb
179
+ - features/cli.feature
180
+ - features/generator.feature
181
+ - features/step_definitions/feature_steps.rb
152
182
  - features/support/setup.rb
153
183
  - lib/generators/active_record/release_notes_generator.rb
154
184
  - lib/generators/active_record/templates/release_notes_migration.rb
@@ -220,6 +250,7 @@ files:
220
250
  - spec/dummy/release_notes/20140703165131_0_4_0.md
221
251
  - spec/dummy/release_notes/20140703165820_0_5_0.md
222
252
  - spec/dummy/release_notes/20140713050803_0_5_1.md
253
+ - spec/dummy/release_notes/20140715165429_1_0_0.md
223
254
  - spec/dummy/release_notes/README.md
224
255
  - spec/dummy/release_notes/stamp
225
256
  - spec/factories/release_notes.rb
@@ -252,6 +283,9 @@ signing_key:
252
283
  specification_version: 4
253
284
  summary: An easy way to incorporate and manage release notes.
254
285
  test_files:
286
+ - features/cli.feature
287
+ - features/generator.feature
288
+ - features/step_definitions/feature_steps.rb
255
289
  - features/support/setup.rb
256
290
  - spec/controllers/release_notes/release_notes_controller_spec.rb
257
291
  - spec/dummy/README.rdoc
@@ -304,6 +338,7 @@ test_files:
304
338
  - spec/dummy/release_notes/20140703165131_0_4_0.md
305
339
  - spec/dummy/release_notes/20140703165820_0_5_0.md
306
340
  - spec/dummy/release_notes/20140713050803_0_5_1.md
341
+ - spec/dummy/release_notes/20140715165429_1_0_0.md
307
342
  - spec/dummy/release_notes/README.md
308
343
  - spec/dummy/release_notes/stamp
309
344
  - spec/factories/release_notes.rb
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-2.0.0-p353@eanlain