right_develop 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --format=nested
3
+ --backtrace
4
+ --debugger
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ == 1.0
2
+
3
+ Initial release calved from RightSupport.
data/Gemfile ADDED
@@ -0,0 +1,26 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Runtime dependencies of RightDevelop
4
+ gem "rake", [">= 0.8.7", "< 0.10"]
5
+ gem "right_support", "~> 2.0"
6
+ gem "builder", "~> 3.0"
7
+ gem "rspec", [">= 1.3", "< 3.0"]
8
+ gem "cucumber", "~> 1.0"
9
+
10
+ # Gems used during RightDevelop development that should be called out in the gemspec
11
+ group :development do
12
+ gem "jeweler", "~> 1.8.3"
13
+ gem "rdoc", ">= 2.4.2"
14
+ gem "syntax", "~> 1.0.0" #rspec will syntax-highlight code snippets if this gem is available
15
+ gem "nokogiri", "~> 1.5"
16
+ gem "flexmock", "~> 0.8.7", :require => nil
17
+ gem "activesupport"
18
+ gem "libxml-ruby", "~> 2.4.0"
19
+ end
20
+
21
+ # Gems that are only used locally by this repo to run tests and should NOT be called out in the gemspec
22
+ group :test do
23
+ gemspec
24
+ gem "ruby-debug", ">= 0.10", :platforms => :ruby_18
25
+ gem "ruby-debug19", ">= 0.11.6", :platforms => :ruby_19
26
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ right_develop (1.1.0)
5
+ builder (~> 3.0)
6
+ cucumber (~> 1.0)
7
+ rake (>= 0.8.7, < 0.10)
8
+ right_support (~> 2.0)
9
+ rspec (>= 1.3, < 3.0)
10
+
11
+ GEM
12
+ remote: http://rubygems.org/
13
+ specs:
14
+ activesupport (3.2.11)
15
+ i18n (~> 0.6)
16
+ multi_json (~> 1.0)
17
+ archive-tar-minitar (0.5.2)
18
+ builder (3.1.4)
19
+ columnize (0.3.6)
20
+ cucumber (1.2.1)
21
+ builder (>= 2.1.2)
22
+ diff-lcs (>= 1.1.3)
23
+ gherkin (~> 2.11.0)
24
+ json (>= 1.4.6)
25
+ diff-lcs (1.1.3)
26
+ flexmock (0.8.11)
27
+ gherkin (2.11.6)
28
+ json (>= 1.7.6)
29
+ git (1.2.5)
30
+ i18n (0.6.1)
31
+ jeweler (1.8.4)
32
+ bundler (~> 1.0)
33
+ git (>= 1.2.5)
34
+ rake
35
+ rdoc
36
+ json (1.7.6)
37
+ libxml-ruby (2.4.0)
38
+ linecache (0.46)
39
+ rbx-require-relative (> 0.0.4)
40
+ linecache19 (0.5.12)
41
+ ruby_core_source (>= 0.1.4)
42
+ multi_json (1.5.0)
43
+ nokogiri (1.5.6)
44
+ rake (0.9.6)
45
+ rbx-require-relative (0.0.9)
46
+ rdoc (3.12.1)
47
+ json (~> 1.4)
48
+ right_support (2.6.17)
49
+ rspec (2.12.0)
50
+ rspec-core (~> 2.12.0)
51
+ rspec-expectations (~> 2.12.0)
52
+ rspec-mocks (~> 2.12.0)
53
+ rspec-core (2.12.2)
54
+ rspec-expectations (2.12.1)
55
+ diff-lcs (~> 1.1.3)
56
+ rspec-mocks (2.12.2)
57
+ ruby-debug (0.10.4)
58
+ columnize (>= 0.1)
59
+ ruby-debug-base (~> 0.10.4.0)
60
+ ruby-debug-base (0.10.4)
61
+ linecache (>= 0.3)
62
+ ruby-debug-base19 (0.11.25)
63
+ columnize (>= 0.3.1)
64
+ linecache19 (>= 0.5.11)
65
+ ruby_core_source (>= 0.1.4)
66
+ ruby-debug19 (0.11.6)
67
+ columnize (>= 0.3.1)
68
+ linecache19 (>= 0.5.11)
69
+ ruby-debug-base19 (>= 0.11.19)
70
+ ruby_core_source (0.1.5)
71
+ archive-tar-minitar (>= 0.5.2)
72
+ syntax (1.0.0)
73
+
74
+ PLATFORMS
75
+ ruby
76
+
77
+ DEPENDENCIES
78
+ activesupport
79
+ builder (~> 3.0)
80
+ cucumber (~> 1.0)
81
+ flexmock (~> 0.8.7)
82
+ jeweler (~> 1.8.3)
83
+ libxml-ruby (~> 2.4.0)
84
+ nokogiri (~> 1.5)
85
+ rake (>= 0.8.7, < 0.10)
86
+ rdoc (>= 2.4.2)
87
+ right_develop!
88
+ right_support (~> 2.0)
89
+ rspec (>= 1.3, < 3.0)
90
+ ruby-debug (>= 0.10)
91
+ ruby-debug19 (>= 0.11.6)
92
+ syntax (~> 1.0.0)
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013- RightScale, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,50 @@
1
+ RightDevelop is a library of reusable, unit- and functional-tested Ruby code that RightScale has found broadly useful.
2
+
3
+ == What Does It Do?
4
+
5
+ === Continuous Integration
6
+
7
+ Jenkins groks JUnit XML test results very well, and has lots of hidden features associated with them. Tests are tests,
8
+ so we've written an RSpec formatter that Jenkins will feel right at home with!
9
+
10
+ To use our CI harness, just add the following to your Rakefile (or into lib/tasks/ci.rake):
11
+
12
+ require 'right_develop'
13
+ RightDevelop::CI::RakeTask.new
14
+
15
+ ==== Customizing your CI Harness
16
+
17
+ You can override various aspects of the CI harness' behavior by passing a block to the constructor which
18
+ tweaks various instance variables of the resulting Rake task:
19
+
20
+ RightDevelop::CI::RakeTask.new do |task|
21
+ task.ci_namespace = :my_happy_ci
22
+ task.rspec_pattern = "spec/important/**/*_spec.rb" # only run the important specs for CI
23
+ task.output_path = "ci_results" # use ci_results as the base dir for all output files
24
+ task.rspec_output = "happy_specs.xml" # write to ci_results/rspec/happy_specs.xml
25
+ end
26
+
27
+ ==== Keeping the CI Harness Out of Production
28
+
29
+ We recommend that you don't install RightDevelop -- or other test-only gems such as rspec -- when you deploy
30
+ your code to production. This improves the startup time and performance of your app, and prevents instability
31
+ due to potential bugs in test code.
32
+
33
+ To prevent RightDevelop from shipping to production, simply put it in the "development" group of your Gemfile:
34
+
35
+ group :development do
36
+ gem 'right_develop'
37
+ end
38
+
39
+ And ensure that you deploy your code using Bundler's --without flag:
40
+
41
+ bundle install --deployment --without development
42
+
43
+ And finally, modify your Rakefile so you can tolerate the absence of the RightDevelop rake classes. For this,
44
+ you can use RightSupport's Kernel#require_succeeds? extension to conditionally instantiate the Rake tasks:
45
+
46
+ require 'right_support'
47
+
48
+ if require_succeeds?('right_develop')
49
+ RightDevelop::CI::RakeTask.new
50
+ end
data/Rakefile ADDED
@@ -0,0 +1,67 @@
1
+ # -*-ruby-*-
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+
5
+ require 'rake'
6
+ require 'rdoc/task'
7
+ require 'rubygems/package_task'
8
+
9
+ require 'rake/clean'
10
+ require 'rspec/core/rake_task'
11
+ require 'cucumber/rake/task'
12
+
13
+ # We use RightDevelop's CI harness in its own Rakefile. Hooray dogfood!
14
+ require 'right_develop'
15
+
16
+ # But, we have a very special need, because OUR Cucumbers need to run with a pristine
17
+ # environment that isn't polluted by RVM or RubyGems or anyone else, in order to validate
18
+ # that RightDevelop's CI harness doesn't break your app if those gems are unavailable.
19
+ # Thus when our own Rake task runs spec or cucumber as a subprocess, we need to give it
20
+ # a pristine non-bundled environment, so it can use Bundler.with_clean_env to launch
21
+ # subprocesses.
22
+ require File.expand_path('../features/support/file_utils_bundler_mixin', __FILE__)
23
+
24
+ desc "Run unit tests"
25
+ task :default => :spec
26
+
27
+ desc "Run unit tests"
28
+ RSpec::Core::RakeTask.new do |t|
29
+ t.pattern = Dir['**/*_spec.rb']
30
+ end
31
+
32
+ desc "Run functional tests"
33
+ Cucumber::Rake::Task.new do |t|
34
+ t.cucumber_opts = %w{--color --format pretty}
35
+ end
36
+
37
+ desc 'Generate documentation for the right_develop gem.'
38
+ Rake::RDocTask.new(:rdoc) do |rdoc|
39
+ rdoc.rdoc_dir = 'doc'
40
+ rdoc.title = 'RightDevelop'
41
+ rdoc.options << '--line-numbers' << '--inline-source'
42
+ rdoc.rdoc_files.include('README.rdoc')
43
+ rdoc.rdoc_files.include('lib/**/*.rb')
44
+ rdoc.rdoc_files.exclude('features/**/*')
45
+ rdoc.rdoc_files.exclude('spec/**/*')
46
+ end
47
+
48
+ require 'jeweler'
49
+ Jeweler::Tasks.new do |gem|
50
+ # gem is a Gem::Specification; see http://docs.rubygems.org/read/chapter/20 for more options
51
+ gem.name = "right_develop"
52
+ gem.homepage = "https://github.com/rightscale/right_develop"
53
+ gem.license = "MIT"
54
+ gem.summary = %Q{Reusable dev & test code.}
55
+ gem.description = %Q{A toolkit of development tools created by RightScale.}
56
+ gem.email = "support@rightscale.com"
57
+ gem.authors = ["Tony Spataro"]
58
+ gem.rubygems_version = "1.3.7"
59
+ end
60
+
61
+ # This is a closed-source gem; omit gemcutter tasks so people don't accidentally
62
+ # push this gem to the public!
63
+ #Jeweler::RubygemsDotOrgTasks.new
64
+
65
+ CLEAN.include('pkg')
66
+
67
+ RightDevelop::CI::RakeTask.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.1.0
@@ -0,0 +1,27 @@
1
+ Feature: Cucumber 1.x support
2
+ In order to facilitate TDD and enhance code quality
3
+ RightDevelop should provide CI tasks with Cucumber with JUnit XML output
4
+ So any Ruby project can have a beautiful, info-rich Jenkins project
5
+
6
+ Background:
7
+ Given a Ruby application
8
+ And a Gemfile
9
+ And a gem dependency on 'rake ~> 0.9'
10
+ And a gem dependency on 'cucumber ~> 1.0'
11
+ And the Rakefile contains a RightDevelop::CI::RakeTask
12
+
13
+ Scenario: passing Cucumber features
14
+ Given a trivial Cucumber feature
15
+ When I install the bundle
16
+ And I rake 'ci:cucumber'
17
+ Then the command should succeed
18
+ And the output should contain '** Execute ci:cucumber'
19
+ And the directory 'measurement/cucumber' should contain files
20
+
21
+ Scenario: failing Cucumber features
22
+ Given a trivial failing Cucumber feature
23
+ When I install the bundle
24
+ And I rake 'ci:cucumber'
25
+ Then the command should fail
26
+ And the output should contain '** Execute ci:cucumber'
27
+ And the directory 'measurement/cucumber' should contain files
@@ -0,0 +1,27 @@
1
+ Feature: basic Rake integration
2
+ In order to promote predictable, reliable Continuous Integration
3
+ RightDevelop should expose a "ci:" Rake namespace
4
+
5
+ Background:
6
+ Given a Ruby application
7
+ And a Gemfile
8
+ And a gem dependency on 'rake ~> 0.9'
9
+
10
+ Scenario: list Rake tasks
11
+ Given the Rakefile contains a RightDevelop::CI::RakeTask
12
+ When I install the bundle
13
+ And I rake '-T'
14
+ And the output should contain 'ci:cucumber'
15
+ And the output should contain 'ci:spec'
16
+
17
+ Scenario: override namespace
18
+ Given the Rakefile contains:
19
+ """
20
+ RightDevelop::CI::RakeTask.new do |task|
21
+ task.ci_namespace = :funkalicious
22
+ end
23
+ """
24
+ When I install the bundle
25
+ And I rake '-T'
26
+ Then the output should contain 'funkalicious:cucumber'
27
+ Then the output should contain 'funkalicious:spec'
@@ -0,0 +1,67 @@
1
+ Feature: RSpec 1.x support
2
+ In order to facilitate TDD and enhance code quality
3
+ RightDevelop should provide a Rake CI harness with JUnit XML output
4
+ So any Ruby project can have a beautiful, info-rich Jenkins project
5
+
6
+ Background:
7
+ Given a Ruby application
8
+ And a Gemfile
9
+ And a gem dependency on 'rake ~> 0.9'
10
+ And a gem dependency on 'rspec ~> 1.0'
11
+ And the Rakefile contains a RightDevelop::CI::RakeTask
12
+
13
+ Scenario: passing examples
14
+ Given a trivial RSpec spec
15
+ When I install the bundle
16
+ And I rake 'ci:spec'
17
+ Then the command should succeed
18
+ And the file 'measurement/rspec/rspec.xml' should mention 2 passing test cases
19
+ And the file 'measurement/rspec/rspec.xml' should mention 0 failing test cases
20
+
21
+ Scenario: failing examples
22
+ Given a trivial failing RSpec spec
23
+ When I install the bundle
24
+ And I rake 'ci:spec'
25
+ Then the command should fail
26
+ And the file 'measurement/rspec/rspec.xml' should mention 2 passing test cases
27
+ And the file 'measurement/rspec/rspec.xml' should mention 1 failing test case
28
+
29
+ Scenario: override input file pattern
30
+ Given an RSpec spec named 'passing_spec.rb' with content:
31
+ """
32
+ describe String do
33
+ it 'is cool' do
34
+ 'cool'.should == 'cool'
35
+ end
36
+ end
37
+ """
38
+ And an RSpec spec named 'failing_spec.rb' with content:
39
+ """
40
+ describe String do
41
+ it 'is uncool' do
42
+ 'cool'.should == 'uncool'
43
+ end
44
+ end
45
+ """
46
+ And the Rakefile contains:
47
+ """
48
+ RightDevelop::CI::RakeTask.new do |task|
49
+ task.rspec_pattern = 'spec/passing_spec.rb'
50
+ end
51
+ """
52
+ When I install the bundle
53
+ And I rake 'ci:spec'
54
+ Then the command should succeed
55
+
56
+ Scenario: override output file location
57
+ Given a trivial RSpec spec
58
+ And the Rakefile contains:
59
+ """
60
+ RightDevelop::CI::RakeTask.new do |task|
61
+ task.rspec_output = 'awesome.xml'
62
+ end
63
+ """
64
+ When I install the bundle
65
+ And I rake 'ci:spec'
66
+ Then the command should succeed
67
+ And the file 'measurement/rspec/awesome.xml' should exist
@@ -0,0 +1,67 @@
1
+ Feature: RSpec 2.x support
2
+ In order to facilitate TDD and enhance code quality
3
+ RightDevelop should provide a Rake CI harness with JUnit XML output
4
+ So any Ruby project can have a beautiful, info-rich Jenkins project
5
+
6
+ Background:
7
+ Given a Ruby application
8
+ And a Gemfile
9
+ And a gem dependency on 'rake ~> 0.9'
10
+ And a gem dependency on 'rspec ~> 2.0'
11
+ And the Rakefile contains a RightDevelop::CI::RakeTask
12
+
13
+ Scenario: passing examples
14
+ And a trivial RSpec spec
15
+ When I install the bundle
16
+ And I rake 'ci:spec'
17
+ Then the command should succeed
18
+ And the file 'measurement/rspec/rspec.xml' should mention 2 passing test cases
19
+ And the file 'measurement/rspec/rspec.xml' should mention 0 failing test cases
20
+
21
+ Scenario: failing examples
22
+ And a trivial failing RSpec spec
23
+ When I install the bundle
24
+ And I rake 'ci:spec'
25
+ Then the command should fail
26
+ And the file 'measurement/rspec/rspec.xml' should mention 2 passing test cases
27
+ And the file 'measurement/rspec/rspec.xml' should mention 1 failing test case
28
+
29
+ Scenario: override input file pattern
30
+ Given an RSpec spec named 'passing_spec.rb' with content:
31
+ """
32
+ describe String do
33
+ it 'is cool' do
34
+ 'cool'.should == 'cool'
35
+ end
36
+ end
37
+ """
38
+ And an RSpec spec named 'failing_spec.rb' with content:
39
+ """
40
+ describe String do
41
+ it 'is uncool' do
42
+ 'cool'.should == 'uncool'
43
+ end
44
+ end
45
+ """
46
+ And the Rakefile contains:
47
+ """
48
+ RightDevelop::CI::RakeTask.new do |task|
49
+ task.rspec_pattern = 'spec/passing_spec.rb'
50
+ end
51
+ """
52
+ When I install the bundle
53
+ And I rake 'ci:spec'
54
+ Then the command should succeed
55
+
56
+ Scenario: override output file location
57
+ Given a trivial RSpec spec
58
+ And the Rakefile contains:
59
+ """
60
+ RightDevelop::CI::RakeTask.new do |task|
61
+ task.rspec_output = 'awesome.xml'
62
+ end
63
+ """
64
+ When I install the bundle
65
+ And I rake 'ci:spec'
66
+ Then the command should succeed
67
+ And the file 'measurement/rspec/awesome.xml' should exist