gitnesse 0.12.6 → 1.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +6 -0
  3. data/Rakefile +6 -11
  4. data/bin/.keep +0 -0
  5. data/bin/gitnesse +2 -32
  6. data/config/gitnesse.rb.example +2 -4
  7. data/gitnesse.gemspec +22 -21
  8. data/lib/gitnesse/cli/helpers/config_helpers.rb +13 -0
  9. data/lib/gitnesse/cli/helpers/feature_helpers.rb +26 -0
  10. data/lib/gitnesse/cli/helpers/wiki_helpers.rb +53 -0
  11. data/lib/gitnesse/cli/task/help.rb +42 -0
  12. data/lib/gitnesse/cli/task/info.rb +29 -0
  13. data/lib/gitnesse/cli/task/pull.rb +26 -0
  14. data/lib/gitnesse/cli/task/push.rb +101 -0
  15. data/lib/gitnesse/cli/task/run.rb +85 -0
  16. data/lib/gitnesse/cli/task.rb +67 -0
  17. data/lib/gitnesse/cli.rb +55 -0
  18. data/lib/gitnesse/config.rb +68 -0
  19. data/lib/gitnesse/config_loader.rb +36 -0
  20. data/lib/gitnesse/dependency_checker.rb +86 -0
  21. data/lib/gitnesse/dir_manager.rb +37 -0
  22. data/lib/gitnesse/feature.rb +63 -0
  23. data/lib/gitnesse/feature_extractor.rb +29 -0
  24. data/lib/gitnesse/feature_transform.rb +30 -0
  25. data/lib/gitnesse/hooks/gitnesse.rb +5 -0
  26. data/lib/gitnesse/hooks.rb +30 -33
  27. data/lib/gitnesse/railtie.rb +3 -1
  28. data/lib/gitnesse/rake/tasks.rake +11 -0
  29. data/lib/gitnesse/tasks.rb +7 -4
  30. data/lib/gitnesse/version.rb +1 -1
  31. data/lib/gitnesse/wiki/page.rb +103 -0
  32. data/lib/gitnesse/wiki.rb +80 -143
  33. data/lib/gitnesse.rb +10 -102
  34. data/spec/lib/cli/task/help_spec.rb +34 -0
  35. data/spec/lib/cli/task/info_spec.rb +22 -0
  36. data/spec/lib/cli/task/pull_spec.rb +24 -0
  37. data/spec/lib/cli/task/push_spec.rb +24 -0
  38. data/spec/lib/cli_spec.rb +13 -0
  39. data/spec/lib/config_loader_spec.rb +46 -0
  40. data/spec/lib/config_spec.rb +61 -0
  41. data/spec/lib/dependency_checker_spec.rb +193 -0
  42. data/spec/lib/dir_manager_spec.rb +46 -0
  43. data/spec/lib/feature_extractor_spec.rb +30 -0
  44. data/spec/lib/feature_spec.rb +53 -0
  45. data/spec/lib/feature_transform_spec.rb +25 -0
  46. data/spec/lib/hooks_spec.rb +40 -0
  47. data/spec/lib/version_spec.rb +9 -0
  48. data/spec/lib/wiki/page_spec.rb +68 -0
  49. data/spec/lib/wiki_spec.rb +34 -0
  50. data/spec/spec_helper.rb +4 -0
  51. data/spec/support/cli.rb +20 -0
  52. data/spec/support/example_config/gitnesse.rb +4 -0
  53. data/{test/test_helper.rb → spec/support/example_features/addition.feature} +0 -16
  54. data/spec/support/example_features/division.feature +10 -0
  55. data/spec/support/example_wiki_pages/developer_can_sync_features_to_code.md +29 -0
  56. data/spec/support_helper.rb +79 -0
  57. metadata +103 -109
  58. data/README.md +0 -85
  59. data/features/step_definitions/gitnesse_steps.rb +0 -54
  60. data/features/support/env.rb +0 -65
  61. data/features/sync_wiki_features_to_code.feature +0 -29
  62. data/lib/gitnesse/configuration.rb +0 -54
  63. data/lib/gitnesse/dependencies.rb +0 -39
  64. data/lib/gitnesse/features.rb +0 -38
  65. data/lib/gitnesse/git_config.rb +0 -39
  66. data/lib/gitnesse/support/hook.rb +0 -11
  67. data/lib/gitnesse/tasks.rake +0 -34
  68. data/test/lib/gitnesse/build_page_content_test.rb +0 -89
  69. data/test/lib/gitnesse/commit_info_test.rb +0 -16
  70. data/test/lib/gitnesse/configuration_defaults_test.rb +0 -11
  71. data/test/lib/gitnesse/configuration_to_hash_test.rb +0 -25
  72. data/test/lib/gitnesse/custom_branch_test.rb +0 -24
  73. data/test/lib/gitnesse/dependencies_check_test.rb +0 -73
  74. data/test/lib/gitnesse/extract_features_test.rb +0 -44
  75. data/test/lib/gitnesse/gather_test.rb +0 -30
  76. data/test/lib/gitnesse/load_feature_files_into_wiki_test.rb +0 -34
  77. data/test/lib/gitnesse/read_git_config_test.rb +0 -33
  78. data/test/lib/gitnesse/strip_results_test.rb +0 -52
  79. data/test/lib/gitnesse/version_test.rb +0 -7
  80. data/test/lib/gitnesse/wiki_append_results_test.rb +0 -50
  81. data/test/lib/gitnesse/write_file_test.rb +0 -18
  82. data/test/wiki_test_helper.rb +0 -11
metadata CHANGED
@@ -1,206 +1,200 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitnesse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.6
5
- prerelease:
4
+ version: 1.0.0.beta2
6
5
  platform: ruby
7
6
  authors:
8
7
  - www.hybridgroup.com
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-18 00:00:00.000000000 Z
11
+ date: 2013-09-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '1.3'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
26
+ version: '1.3'
30
27
  - !ruby/object:Gem::Dependency
31
- name: gollum
28
+ name: git
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: 2.3.12
33
+ version: 1.2.6
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: 2.3.12
40
+ version: 1.2.6
46
41
  - !ruby/object:Gem::Dependency
47
- name: minitest-matchers
42
+ name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
- name: mocha
56
+ name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ~>
68
60
  - !ruby/object:Gem::Version
69
- version: '0'
61
+ version: 2.14.1
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ~>
76
67
  - !ruby/object:Gem::Version
77
- version: '0'
68
+ version: 2.14.1
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: cucumber
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- - !ruby/object:Gem::Dependency
95
- name: rake
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
72
  requirements:
99
- - - ! '>='
73
+ - - ~>
100
74
  - !ruby/object:Gem::Version
101
- version: '0'
75
+ version: 1.3.4
102
76
  type: :development
103
77
  prerelease: false
104
78
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
79
  requirements:
107
- - - ! '>='
80
+ - - ~>
108
81
  - !ruby/object:Gem::Version
109
- version: '0'
110
- description: Use github wiki to store feature stories, then execute then using Cucumber
82
+ version: 1.3.4
83
+ description: |-
84
+ Gitnesse lets you sync Cucumber feature stories
85
+ through a Git-based wiki, and display current
86
+ scenario results on wiki pages
111
87
  email:
112
88
  - info@hybridgroup.com
113
89
  executables:
90
+ - .keep
114
91
  - gitnesse
115
92
  extensions: []
116
93
  extra_rdoc_files: []
117
94
  files:
118
95
  - .gitignore
96
+ - .travis.yml
119
97
  - Gemfile
120
98
  - LICENSE.txt
121
- - README.md
122
99
  - Rakefile
100
+ - bin/.keep
123
101
  - bin/gitnesse
124
102
  - config/gitnesse.rb.example
125
- - features/step_definitions/gitnesse_steps.rb
126
- - features/support/env.rb
127
- - features/sync_wiki_features_to_code.feature
128
103
  - gitnesse.gemspec
129
104
  - lib/gitnesse.rb
130
- - lib/gitnesse/configuration.rb
131
- - lib/gitnesse/dependencies.rb
132
- - lib/gitnesse/features.rb
133
- - lib/gitnesse/git_config.rb
105
+ - lib/gitnesse/cli.rb
106
+ - lib/gitnesse/cli/helpers/config_helpers.rb
107
+ - lib/gitnesse/cli/helpers/feature_helpers.rb
108
+ - lib/gitnesse/cli/helpers/wiki_helpers.rb
109
+ - lib/gitnesse/cli/task.rb
110
+ - lib/gitnesse/cli/task/help.rb
111
+ - lib/gitnesse/cli/task/info.rb
112
+ - lib/gitnesse/cli/task/pull.rb
113
+ - lib/gitnesse/cli/task/push.rb
114
+ - lib/gitnesse/cli/task/run.rb
115
+ - lib/gitnesse/config.rb
116
+ - lib/gitnesse/config_loader.rb
117
+ - lib/gitnesse/dependency_checker.rb
118
+ - lib/gitnesse/dir_manager.rb
119
+ - lib/gitnesse/feature.rb
120
+ - lib/gitnesse/feature_extractor.rb
121
+ - lib/gitnesse/feature_transform.rb
134
122
  - lib/gitnesse/hooks.rb
123
+ - lib/gitnesse/hooks/gitnesse.rb
135
124
  - lib/gitnesse/railtie.rb
136
- - lib/gitnesse/support/hook.rb
137
- - lib/gitnesse/tasks.rake
125
+ - lib/gitnesse/rake/tasks.rake
138
126
  - lib/gitnesse/tasks.rb
139
127
  - lib/gitnesse/version.rb
140
128
  - lib/gitnesse/wiki.rb
141
- - test/lib/gitnesse/build_page_content_test.rb
142
- - test/lib/gitnesse/commit_info_test.rb
143
- - test/lib/gitnesse/configuration_defaults_test.rb
144
- - test/lib/gitnesse/configuration_to_hash_test.rb
145
- - test/lib/gitnesse/custom_branch_test.rb
146
- - test/lib/gitnesse/dependencies_check_test.rb
147
- - test/lib/gitnesse/extract_features_test.rb
148
- - test/lib/gitnesse/gather_test.rb
149
- - test/lib/gitnesse/load_feature_files_into_wiki_test.rb
150
- - test/lib/gitnesse/read_git_config_test.rb
151
- - test/lib/gitnesse/strip_results_test.rb
152
- - test/lib/gitnesse/version_test.rb
153
- - test/lib/gitnesse/wiki_append_results_test.rb
154
- - test/lib/gitnesse/write_file_test.rb
155
- - test/test_helper.rb
156
- - test/wiki_test_helper.rb
129
+ - lib/gitnesse/wiki/page.rb
130
+ - spec/lib/cli/task/help_spec.rb
131
+ - spec/lib/cli/task/info_spec.rb
132
+ - spec/lib/cli/task/pull_spec.rb
133
+ - spec/lib/cli/task/push_spec.rb
134
+ - spec/lib/cli_spec.rb
135
+ - spec/lib/config_loader_spec.rb
136
+ - spec/lib/config_spec.rb
137
+ - spec/lib/dependency_checker_spec.rb
138
+ - spec/lib/dir_manager_spec.rb
139
+ - spec/lib/feature_extractor_spec.rb
140
+ - spec/lib/feature_spec.rb
141
+ - spec/lib/feature_transform_spec.rb
142
+ - spec/lib/hooks_spec.rb
143
+ - spec/lib/version_spec.rb
144
+ - spec/lib/wiki/page_spec.rb
145
+ - spec/lib/wiki_spec.rb
146
+ - spec/spec_helper.rb
147
+ - spec/support/cli.rb
148
+ - spec/support/example_config/gitnesse.rb
149
+ - spec/support/example_features/addition.feature
150
+ - spec/support/example_features/division.feature
151
+ - spec/support/example_wiki_pages/developer_can_sync_features_to_code.md
152
+ - spec/support_helper.rb
157
153
  homepage: https://github.com/hybridgroup/gitnesse
158
- licenses: []
154
+ licenses:
155
+ - MIT
156
+ metadata: {}
159
157
  post_install_message:
160
158
  rdoc_options: []
161
159
  require_paths:
162
160
  - lib
163
161
  required_ruby_version: !ruby/object:Gem::Requirement
164
- none: false
165
162
  requirements:
166
- - - ! '>='
163
+ - - '>='
167
164
  - !ruby/object:Gem::Version
168
165
  version: '0'
169
- segments:
170
- - 0
171
- hash: 3165279517982023743
172
166
  required_rubygems_version: !ruby/object:Gem::Requirement
173
- none: false
174
167
  requirements:
175
- - - ! '>='
168
+ - - '>'
176
169
  - !ruby/object:Gem::Version
177
- version: '0'
178
- segments:
179
- - 0
180
- hash: 3165279517982023743
170
+ version: 1.3.1
181
171
  requirements: []
182
172
  rubyforge_project:
183
- rubygems_version: 1.8.24
173
+ rubygems_version: 2.0.3
184
174
  signing_key:
185
- specification_version: 3
186
- summary: Features on git-based Wiki!
175
+ specification_version: 4
176
+ summary: Sync your feature stories using a Git-based wiki!
187
177
  test_files:
188
- - features/step_definitions/gitnesse_steps.rb
189
- - features/support/env.rb
190
- - features/sync_wiki_features_to_code.feature
191
- - test/lib/gitnesse/build_page_content_test.rb
192
- - test/lib/gitnesse/commit_info_test.rb
193
- - test/lib/gitnesse/configuration_defaults_test.rb
194
- - test/lib/gitnesse/configuration_to_hash_test.rb
195
- - test/lib/gitnesse/custom_branch_test.rb
196
- - test/lib/gitnesse/dependencies_check_test.rb
197
- - test/lib/gitnesse/extract_features_test.rb
198
- - test/lib/gitnesse/gather_test.rb
199
- - test/lib/gitnesse/load_feature_files_into_wiki_test.rb
200
- - test/lib/gitnesse/read_git_config_test.rb
201
- - test/lib/gitnesse/strip_results_test.rb
202
- - test/lib/gitnesse/version_test.rb
203
- - test/lib/gitnesse/wiki_append_results_test.rb
204
- - test/lib/gitnesse/write_file_test.rb
205
- - test/test_helper.rb
206
- - test/wiki_test_helper.rb
178
+ - spec/lib/cli/task/help_spec.rb
179
+ - spec/lib/cli/task/info_spec.rb
180
+ - spec/lib/cli/task/pull_spec.rb
181
+ - spec/lib/cli/task/push_spec.rb
182
+ - spec/lib/cli_spec.rb
183
+ - spec/lib/config_loader_spec.rb
184
+ - spec/lib/config_spec.rb
185
+ - spec/lib/dependency_checker_spec.rb
186
+ - spec/lib/dir_manager_spec.rb
187
+ - spec/lib/feature_extractor_spec.rb
188
+ - spec/lib/feature_spec.rb
189
+ - spec/lib/feature_transform_spec.rb
190
+ - spec/lib/hooks_spec.rb
191
+ - spec/lib/version_spec.rb
192
+ - spec/lib/wiki/page_spec.rb
193
+ - spec/lib/wiki_spec.rb
194
+ - spec/spec_helper.rb
195
+ - spec/support/cli.rb
196
+ - spec/support/example_config/gitnesse.rb
197
+ - spec/support/example_features/addition.feature
198
+ - spec/support/example_features/division.feature
199
+ - spec/support/example_wiki_pages/developer_can_sync_features_to_code.md
200
+ - spec/support_helper.rb
data/README.md DELETED
@@ -1,85 +0,0 @@
1
- # Gitnesse
2
-
3
- Gitnesse is an acceptance testing tool.
4
-
5
- It enables a project to store Cucumber feature stories in a git-based wiki, test them against your code, and then update the wiki with the latest test results.
6
-
7
- The advantage is, that the features are on a wiki, so non-programmers can see them, and edit using the wiki. Hence an awesome bi-directional testing flow between developers and non-developers on a team.
8
-
9
- Conceptually influenced by Fitnesse http://fitnesse.org/ thank you Uncle Bob!
10
-
11
- ## Installation
12
-
13
- Add this line to your application's Gemfile:
14
-
15
- gem 'gitnesse'
16
-
17
- And then execute:
18
-
19
- $ bundle
20
-
21
- Or install it yourself as:
22
-
23
- $ gem install gitnesse
24
-
25
- Create a `gitnesse.rb` file somewhere in your project, and add something like
26
- the following to it:
27
-
28
- Gitnesse.configure do |config|
29
- config.repository_url = "git@github.com:hybridgroup/gitnesse-demo.wiki"
30
- config.annotate_results = true
31
- config.info = "Bob Martin's development laptop"
32
- end
33
-
34
- ## Git Config
35
-
36
- Gitnesse depends on two values being present in your `gitconfig`: `user.name`
37
- and `user.email`. These will be used when annotating test results, and to
38
- identify commits you make to the feature wiki. If Gitnesse complains that you
39
- don't have these set, you can fix this by entering the following lines in your
40
- terminal:
41
-
42
- $ git config --add --global user.name <your_name>
43
- $ git config --add --global user.email <your_email>
44
-
45
- ## rake tasks
46
-
47
- $ rake gitnesse:pull
48
- $ rake gitnesse:push
49
- $ rake gitnesse:run
50
- $ rake gitnesse:info
51
- $ rake gitnesse:push_results
52
-
53
- ## Usage In Rails 3
54
-
55
- For Rails 3 the rake tasks should automatically just appear, as long as you have added the gitnesse gem to your Gemfile.
56
-
57
- There is an example application using Rails 3 located here: [https://github.com/hybridgroup/gitnesse-example-rails](https://github.com/hybridgroup/gitnesse-example-rails)
58
-
59
- ## Usage In Sinatra
60
-
61
- To use gitnesse in a Sinatra application, simple add this line of code to your Rakefile:
62
-
63
- require "gitnesse/tasks"
64
-
65
- There is an example application using Sinatra located here: [https://github.com/hybridgroup/gitnesse-example-sinatra](https://github.com/hybridgroup/gitnesse-example-sinatra)
66
-
67
- ## Other Usage
68
-
69
- Want to use plain old Gitnesse? There is an executable, if you're allergic to rake tasks:
70
-
71
- $ gitnesse
72
-
73
-
74
- ## TODO
75
-
76
- - pluggable feature runners, so can be used with Spinach, Cucumber-JS, or ?
77
- - standalone server so end users to run tests and see live results, just like Fitnesse
78
-
79
- ## Contributing
80
-
81
- 1. Fork it
82
- 2. Create your feature branch (`git checkout -b my-new-feature`)
83
- 3. Commit your changes (`git commit -am 'Add some feature'`)
84
- 4. Push to the branch (`git push origin my-new-feature`)
85
- 5. Create new Pull Request
@@ -1,54 +0,0 @@
1
- Given /^there is a code repo with cucumber features defined$/ do
2
- @repo_dir = File.join(Dir.home, ".gitnesse_repo")
3
- end
4
-
5
- Given /^there is a code repo without any cucumber features defined$/ do
6
- @repo_dir = File.join(Dir.home, ".gitnesse_repo_no_features")
7
- end
8
-
9
- Given /^there is a git wiki with cucumber features defined$/ do
10
- @features_dir = File.join(Dir.home, ".gitnesse_features")
11
-
12
- config_file = File.join(@repo_dir, "gitnesse.rb")
13
- config = File.read(config_file)
14
- config.gsub!(/config\.repository_url.*$/, "config.repository_url = '#{@features_dir}'")
15
- File.open(config_file, 'w') { |file| file.puts config }
16
- end
17
-
18
- Given /^there is a git wiki without any cucumber features defined$/ do
19
- @features_dir = File.join(Dir.home, ".gitnesse_features_no_features")
20
-
21
- config_file = File.join(@repo_dir, "gitnesse.rb")
22
- config = File.read(config_file)
23
- config.gsub!(/config\.repository_url.*$/, "config.repository_url = '#{@features_dir}'")
24
- File.open(config_file, 'w') { |file| file.puts config }
25
- end
26
-
27
- When /^developer pulls feature stories from the wiki$/ do
28
- Dir.chdir(@repo_dir) do
29
- `bundle exec rake gitnesse:pull &> /dev/null`
30
- assert_equal $?, 0
31
- end
32
- end
33
-
34
- When /^developer pushes feature stories to the wiki$/ do
35
- Dir.chdir(@repo_dir) do
36
- `bundle exec rake gitnesse:push &> /dev/null`
37
- assert_equal $?, 0
38
- end
39
- end
40
-
41
- Then /^the feature stories within the code should match the wiki$/ do
42
- assert_dir = File.join(Dir.home, ".gitnesse_features_for_assert")
43
-
44
- `git clone #{@features_dir} #{assert_dir} &> /dev/null`
45
-
46
- repo_features = Dir.glob("#{@repo_dir}/features/*.feature").map { |file| File.basename(file, ".feature") }
47
- wiki_files = Dir.glob("#{assert_dir}/*.md").map { |file| File.basename(file, ".md") }
48
-
49
- FileUtils.rm_rf(assert_dir)
50
-
51
- repo_features.each do |feature|
52
- assert(wiki_files.include?(feature) || wiki_files.include?("#{feature}.feature"))
53
- end
54
- end
@@ -1,65 +0,0 @@
1
- require 'test/unit/assertions'
2
- World(Test::Unit::Assertions)
3
-
4
- puts " Setting up Gitnesse for testing..."
5
-
6
- @features_dir = File.join(Dir.home, ".gitnesse_features")
7
- @features_dir_no_features = File.join(Dir.home, ".gitnesse_features_no_features")
8
- @repo_dir = File.join(Dir.home, ".gitnesse_repo")
9
- @repo_dir_no_features = File.join(Dir.home, ".gitnesse_repo_no_features")
10
-
11
- Dir.mkdir @features_dir
12
- Dir.mkdir @repo_dir
13
- Dir.mkdir @features_dir_no_features
14
- Dir.mkdir @repo_dir_no_features
15
-
16
- Dir.chdir(@features_dir) do
17
- system('git clone --bare https://github.com/hybridgroup/gitnesse-demo.wiki.git . &> /dev/null')
18
- if $? == 0
19
- puts " Cloned demo features to #{@features_dir}."
20
- else
21
- abort " Failed to clone demo features to #{@features_dir}."
22
- end
23
- end
24
-
25
- Dir.chdir(@features_dir_no_features) do
26
- system('git init --bare &> /dev/null')
27
- if $? == 0
28
- puts " Created demo wiki without features in #{@features_dir_no_features}."
29
- else
30
- abort " Failed to create demo wiki without features in #{@features_dir_no_features}."
31
- end
32
- end
33
-
34
- Dir.chdir(@repo_dir) do
35
- system('git clone https://github.com/hybridgroup/gitnesse-example-sinatra.git . &> /dev/null')
36
- if $? == 0
37
- puts " Cloned demo repo to #{@repo_dir}."
38
- else
39
- abort " Failed to clone demo repo to #{@repo_dir}."
40
- end
41
-
42
- system('bundle install --path vendor/bundle &> /dev/null')
43
- if $? == 0
44
- puts " Installed gems for demo wiki."
45
- else
46
- abort " Failed to install gems for demo wiki."
47
- end
48
- end
49
-
50
- Dir.chdir(@repo_dir_no_features) do
51
- FileUtils.cp_r("#{@repo_dir}/.", @repo_dir_no_features)
52
- Dir.glob("#{@repo_dir_no_features}/**/*.feature") do |file|
53
- File.unlink(file)
54
- end
55
- puts " Created demo repo without features."
56
- end
57
-
58
- puts " Finished setting up Gitnesse for testing. Running features.", ""
59
-
60
- at_exit do
61
- FileUtils.rm_rf(@features_dir)
62
- FileUtils.rm_rf(@repo_dir)
63
- FileUtils.rm_rf(@features_dir_no_features)
64
- FileUtils.rm_rf(@repo_dir_no_features)
65
- end
@@ -1,29 +0,0 @@
1
- Feature:
2
- In order to build software that provides the best fitting solution to a user problem
3
- As a developer
4
- I want to be able to test feature stories in my code
5
- And also store the feature stories in a wiki so users can easily view or edit them
6
-
7
- Scenario: Features already exist in wiki but not in code
8
- Given there is a code repo without any cucumber features defined
9
- And there is a git wiki with cucumber features defined
10
- When developer pulls feature stories from the wiki
11
- Then the feature stories within the code should match the wiki
12
-
13
- Scenario: Features already exist in code but not in wiki
14
- Given there is a code repo with cucumber features defined
15
- And there is a git wiki without any cucumber features defined
16
- When developer pushes feature stories to the wiki
17
- Then the feature stories within the code should match the wiki
18
-
19
- Scenario: Features pushes features from code to existing wiki
20
- Given there is a code repo with cucumber features defined
21
- And there is a git wiki with cucumber features defined
22
- When developer pushes feature stories to the wiki
23
- Then the feature stories within the code should match the wiki
24
-
25
- Scenario: Features pulls features from wiki to existing code
26
- Given there is a code repo with cucumber features defined
27
- And there is a git wiki with cucumber features defined
28
- When developer pulls feature stories from the wiki
29
- Then the feature stories within the code should match the wiki
@@ -1,54 +0,0 @@
1
- module Gitnesse
2
- class Configuration
3
- attr_accessor :repository_url
4
- attr_accessor :branch
5
- attr_accessor :target_directory
6
- attr_accessor :annotate_results
7
- attr_accessor :info
8
-
9
- class NoConfigFileError < StandardError ; end
10
- class MultipleConfigFileError < StandardError ; end
11
-
12
- def initialize
13
- @branch = 'master'
14
- @target_directory = File.join(Dir.pwd, 'features')
15
- @annotate_results = false
16
- @info = nil
17
- end
18
-
19
- # Public: Returns the current Gitnesse configuration as a Hash
20
- #
21
- # Returns a hash containing the current Gitnesse configuration
22
- def to_hash
23
- { 'repository_url' => @repository_url,
24
- 'branch' => @branch,
25
- 'target_directory' => @target_directory }
26
- end
27
-
28
- def self.load_using_search
29
- load(ENV['GITNESSE_CONFIG']) and return if ENV['GITNESSE_CONFIG']
30
-
31
- possible_config_files = Dir.glob(File.join("**", "gitnesse.rb"))
32
-
33
- files_with_config = possible_config_files.select do |file_name|
34
- if FileUtils.compare_file(__FILE__, file_name)
35
- false
36
- elsif File.fnmatch("vendor/**/*.rb", file_name)
37
- false
38
- else
39
- file_content = File.read(file_name)
40
- file_content.match("Gitnesse.configure")
41
- end
42
- end
43
-
44
- case files_with_config.length
45
- when 0
46
- raise NoConfigFileError, "Can't find a gitnesse.rb file with Gitnesse configuration."
47
- when 1
48
- load(File.absolute_path(files_with_config.first))
49
- else
50
- raise MultipleConfigFileError, "Several config files found: #{files_with_config.join(", ")}"
51
- end
52
- end
53
- end
54
- end
@@ -1,39 +0,0 @@
1
- module Gitnesse
2
- class Dependencies
3
- class NoGitError < StandardError ; end
4
- class NoCucumberError < StandardError ; end
5
- class NoRepositoryURLError < StandardError ; end
6
- class NoAnnotationInfoError < StandardError ; end
7
-
8
- # Checks Gitnesse's dependencies, and throws an error if one of them is
9
- # missing.
10
- def self.check
11
- check_git
12
- check_cucumber
13
- check_repository_url
14
- check_annotation_info
15
- end
16
-
17
- protected
18
-
19
- def self.check_git
20
- raise NoGitError, "git not found or not working." unless Kernel.system("git --version &> /dev/null")
21
- end
22
-
23
- def self.check_cucumber
24
- raise NoCucumberError, "cucumber not found or not working." unless Kernel.system("cucumber --version &> /dev/null")
25
- end
26
-
27
- def self.check_repository_url
28
- raise NoRepositoryURLError, "You must select a repository_url to run Gitnesse." if Gitnesse.configuration.repository_url.nil?
29
- end
30
-
31
- def self.check_annotation_info
32
- if Gitnesse.configuration.annotate_results
33
- if Gitnesse.configuration.info.nil?
34
- raise NoAnnotationInfoError, "You must enter local information to annotate test results in the wiki"
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,38 +0,0 @@
1
- module Gitnesse
2
- class Features
3
-
4
- # Public: Writes a feature to disk, given the filename and the
5
- # features.
6
- #
7
- # filename - the filename to use for the feature
8
- # features - the features to write to disk
9
- #
10
- def self.write_file(filename, features)
11
- File.open(filename, "w") do |file|
12
- file.write(gather(features))
13
- end
14
- end
15
-
16
- # Public: Gathers features for placing into files. Currently only supports
17
- # one feature per page. Others are discarded
18
- #
19
- # page_features - the features
20
- #
21
- # Returns a string containing the
22
- def self.gather(page_features)
23
- return '' if page_features.nil? || page_features.empty?
24
-
25
- features = ''
26
-
27
- name, content = page_features.shift
28
- puts " \e[32m\e[1mPulling Feature: \e[0m#{name}"
29
- features += content
30
-
31
- page_features.each do |name, feature|
32
- puts " \e[33m\e[1mDiscarding Feature: \e[0m#{name}"
33
- end
34
-
35
- features
36
- end
37
- end
38
- end