From 896fd19a9daa6ab605b37708ad12708c5807a02a Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Thu, 11 Aug 2011 14:42:11 -0700 Subject: [PATCH 001/127] renamed README for markdown formatting --- README | 1 - 1 file changed, 1 deletion(-) delete mode 120000 README diff --git a/README b/README deleted file mode 120000 index 4baf228..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -doc/README \ No newline at end of file From b373eaab32835287624f0ac6b1782dd5f28aae20 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Thu, 11 Aug 2011 14:43:13 -0700 Subject: [PATCH 002/127] added new README file --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 120000 README.md diff --git a/README.md b/README.md new file mode 120000 index 0000000..4baf228 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +doc/README \ No newline at end of file From 99915acde00c79362fa274f0ce485386bbe97222 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Thu, 11 Aug 2011 15:28:54 -0700 Subject: [PATCH 003/127] Expanded the README docco --- doc/README | 134 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 109 insertions(+), 25 deletions(-) diff --git a/doc/README b/doc/README index e4a34b9..c5a6093 100644 --- a/doc/README +++ b/doc/README @@ -1,30 +1,114 @@ -== RSpec Steps -=== ( or: why would I want to relearn how to write specs? ) +# RSpec Steps +## ( or: why would I want to relearn how to write specs? ) -RSpec Steps allows you to chain examples into a series of steps without having -to go the whole 9 yards over to Cucumber. It's often incredibly useful to be -able to aseemble a series of tests that should all pass, but where completely -isolating them is less than sensible. +RSpec Steps allows you to chain examples into a series of steps that run +in sequence and which stop when a step fails. It's often incredibly +useful to be able to aseemble a series of tests that should all pass, +but where completely isolating them is less than sensible. One excellent example is web site integration tests. With RSpec steps you can do: - steps "Add a user" do - it do - visit root - page.should have_text "Login" - end - - it do - fill_in :name, "Johnny User" - click "Login" - page.should have_text "Welcome, Johnny!" - end - - ... - end - -Add dozens of steps to a set. They get run in order, and the state of the -tests isn't reset between them. Better still, if one step fails, the rest are -all marked "pending" so they don't even try to run, which helps speed up -testing. + steps "Login and change password" do + it "should show the login form" do + visit root + page.should have_text "Login" + end + + it "should successfully log in" do + fill_in :name, "Johnny User" + click "Login" + page.should have_text "Welcome, Johnny!" + end + + it "should load the password change form" do + click "My Settings" + click "Update Password" + page.should have_selector("form#update_password") + end + + it "should change the user's password successfully" do + fill_in :password, "foobar" + fill_in :password_confirmation, "foobar" + click "Change Password" + page.should have_text "Password changed successfully!" + User.find_by_name("Johnny User").valid_password?("foobar").should be_true + end + + end + +The examples above will be run in order. State is preserved between examples +inside a "steps" block: any DB transactions will not roll back until the entire +sequence has been complete. + +If any example inside the "steps" block fails, all remaining steps will be marked +pending and therefore skipped. + +## Rationale + +RSpec's philosophy is that all examples should be completely independent. This +is a great philosophy for most purposes, and we recommend you stick to it in +almost all cases. BUT, that complete separation of examples really sucks when +you're trying to write long stories involving many requests. You are usually +stuck with three choices: + +1. Write a sequence of examples, each of which repeats the behavior of all previous examples. Downside: horrendously inefficient. +2. Write a single huge example which performs the entire story. Downside: only one description, no independent reporting of the steps of the story. +3. Use Cucumber. Downside: We agree totally with this guy: http://bit.ly/dmXqnY + +RSpec-steps intentionally breaks RSpec's "independent" philosophy to let us get the +only thing we really want from Cucumber - the ability to execute some examples in sequence, +and skip subsequent steps after a failure. + +## Caveats and cautions + +Don't call "describe" inside of "steps". The behavior is undefined and probably bad. It's +hard to imagine what this should actually mean in any case. Future versions of rspec-steps +will consider this an error. + +Any call to "before" inside a steps block is treated like before(:all) and is run only +once before the first step. Or perhaps more accurately, any call to before() is treated +like before(:each) ... but for these purposes the entire steps block is treated like a +single example. + +## Advanced stuff: shared steps + +If you have (for example) two user stories that share the same first N steps but then +diverge, you can DRY your code out with shared_steps blocks, like so: + + shared_steps "For a logged-in user" do + it "should have login form" + visit root + page.should have_selector "form#login" + end + + it "should log the user in" do + fill_in :name, "Johnny User" + page.should have_text "Welcome, Johnny!" + end + end + + steps "updating password" do + perform_steps "For a logged-in user" + + it "should update the password" do + ... + end + end + + steps "uploading a profile picture" do + perform_steps "For a logged-in user" + + it "should upload a picture" do + ... + end + end + + + + + + + + + From 4486fc674250afadba6e232195c9f09c572e5af1 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Thu, 11 Aug 2011 15:32:44 -0700 Subject: [PATCH 004/127] updated gemspec --- rspec-steps.gemspec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 6d5ee42..93b0c81 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,8 +1,9 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.0.4" + spec.version = "0.0.5" author_list = { - "Judson Lester" => "nyarly@gmail.com" + "Judson Lester" => "judson@lrdesign.com", + "Evan Dorn" => "evan@lrdesign.com" } spec.authors = author_list.keys spec.email = spec.authors.map {|name| author_list[name]} @@ -15,7 +16,7 @@ Gem::Specification.new do |spec| EOD spec.rubyforge_project= spec.name.downcase - spec.homepage = "http://#{spec.rubyforge_project}.rubyforge.org/" + spec.homepage = "https://github.com/LRDesign/rspec-steps" spec.required_rubygems_version = Gem::Requirement.new(">= 0") if spec.respond_to? :required_rubygems_version= @@ -75,7 +76,7 @@ Gem::Specification.new do |spec| spec.add_dependency("rspec", ">= 2.6") - spec.post_install_message = "Another tidy package brought to you by Judson" + spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" end From 5f1ca1860422c25f2c170020569ecc3ede3a14bf Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 30 Aug 2011 14:51:32 -0700 Subject: [PATCH 005/127] Fix to before_ivar handling - important for let! --- .rspec | 3 ++- Gemfile.lock | 2 +- lib/rspec-steps/stepwise.rb | 4 ++++ rspec-steps.gemspec | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.rspec b/.rspec index 7dffdab..3089583 100644 --- a/.rspec +++ b/.rspec @@ -1,5 +1,6 @@ --format documentation +--out last_run -I /home/judson/ruby/gems/rspec-steps/spec_help/interpose -I /home/judson/ruby/gems/rspec-steps/lib -I /home/judson/ruby/gems/rspec-steps/spec_help ---require spec_helper +--require spec_helper \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 267b8fa..2d312f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.0.3) + rspec-steps (0.0.4) rspec (>= 2.6) GEM diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 74b5a31..0c42bb8 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -41,6 +41,7 @@ def eval_before_alls(example_group_instance) example_group_instance.example = whole_list_example world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) ancestors.reverse.each { |ancestor| ancestor.run_hook(:before, :each, example_group_instance) } + store_before_all_ivars(example_group_instance) end def eval_around_eachs(example) @@ -122,6 +123,9 @@ def with_indelible_ivars result = yield @ivars_indelible = old_value result + rescue Object + @ivars_indelible = old_value + raise end def instance_variable_set(name, value) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 93b0c81..cb07f04 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.0.5" + spec.version = "0.0.6" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 60099ddca763aef799931ac4b109cc52c2678002 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 24 Sep 2011 21:10:30 -0700 Subject: [PATCH 006/127] Removing ungemmer from spec_helper (Bundler makes unnecessary) --- Gemfile | 2 +- Gemfile.lock | 4 ++-- spec_help/spec_helper.rb | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 86f571e..2950e80 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "http://judson:hEi4lOra@gems.lrdesign.com" +source "http://lrdesign:quiS6Nef@gems.lrdesign.com" source "http://gemcutter.org" source "http://gems.github.com" diff --git a/Gemfile.lock b/Gemfile.lock index 2d312f6..dc90c15 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,11 @@ PATH remote: . specs: - rspec-steps (0.0.4) + rspec-steps (0.0.6) rspec (>= 2.6) GEM - remote: http://judson:hEi4lOra@gems.lrdesign.com/ + remote: http://lrdesign:quiS6Nef@gems.lrdesign.com/ remote: http://gemcutter.org/ remote: http://gems.github.com/ specs: diff --git a/spec_help/spec_helper.rb b/spec_help/spec_helper.rb index 8be9e12..88cb728 100644 --- a/spec_help/spec_helper.rb +++ b/spec_help/spec_helper.rb @@ -1,4 +1,3 @@ require 'rspec' -require 'spec_help/ungemmer' #Ungemmer::ungem_gemspec From 632d28419918c9380dad49d270be30378b68624f Mon Sep 17 00:00:00 2001 From: Judson Date: Sun, 16 Oct 2011 22:20:38 -0700 Subject: [PATCH 007/127] Making compatible with rspec-2.7.0 --- lib/rspec-steps/stepwise.rb | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 0c42bb8..0e255f0 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -36,8 +36,18 @@ def around(*args, &block) super end + def eval_before_alls(example_group_instance) super + stepped_before_hooks(example_group_instance) + end + + def run_before_all_hooks(example_group_instance) + super + stepped_before_hooks(example_group_instance) + end + + def stepped_before_hooks(example_group_instance) example_group_instance.example = whole_list_example world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) ancestors.reverse.each { |ancestor| ancestor.run_hook(:before, :each, example_group_instance) } @@ -46,18 +56,30 @@ def eval_before_alls(example_group_instance) def eval_around_eachs(example) end + alias run_around_each_hooks eval_around_eachs def eval_before_eachs(example) end + alias run_before_each_hooks eval_before_eachs def eval_after_eachs(example) end + alias run_after_each_hooks eval_after_eachs def eval_after_alls(example_group_instance) + stepped_after_hooks(example_group_instance) + super + end + + def run_after_all_hooks(example_group_instance) + stepped_after_hooks(example_group_instance) + super + end + + def stepped_after_hooks(example_group_instance) example_group_instance.example = whole_list_example ancestors.each { |ancestor| ancestor.run_hook(:after, :each, example_group_instance) } world.run_hook_filtered(:after, :each, self, example_group_instance, whole_list_example) - super end def whole_list_example From 8911ed644d53ef4be3d1686aa0d8df3956e4b731 Mon Sep 17 00:00:00 2001 From: Judson Date: Sun, 16 Oct 2011 22:21:08 -0700 Subject: [PATCH 008/127] Bumping version --- rspec-steps.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index cb07f04..964e964 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.0.6" + spec.version = "0.0.7" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 309018d596ee212aaf67dba53f33f7be4f0c232b Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 11 Jan 2012 15:11:15 -0800 Subject: [PATCH 009/127] Changing example-group to require rspec-core entirely --- .gitignore | 2 ++ lib/rspec-steps/duckpunch/example-group.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 647d3ed..5ff3450 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ pkg .conductor .mtn-ignore *.sw? +rspec-steps-*.gem +.bundle diff --git a/lib/rspec-steps/duckpunch/example-group.rb b/lib/rspec-steps/duckpunch/example-group.rb index 5283359..85068e9 100644 --- a/lib/rspec-steps/duckpunch/example-group.rb +++ b/lib/rspec-steps/duckpunch/example-group.rb @@ -1,4 +1,4 @@ -require 'rspec/core/example_group' +require 'rspec/core' require 'rspec-steps/stepwise' module RSpec::Steps From d5a20ddcd8927d8e58b168f106074058e12bf3b8 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 11 Jan 2012 15:11:46 -0800 Subject: [PATCH 010/127] Version bump --- rspec-steps.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 964e964..3783f09 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.0.7" + spec.version = "0.0.8" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 29995c81631029d8443958ad0a0c5fe3ba1813fd Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Wed, 30 Jan 2013 16:12:50 -0800 Subject: [PATCH 011/127] Rename example group spec to convention --- spec/{example_group.rb => example_group_spec.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/{example_group.rb => example_group_spec.rb} (100%) diff --git a/spec/example_group.rb b/spec/example_group_spec.rb similarity index 100% rename from spec/example_group.rb rename to spec/example_group_spec.rb From ee56ad58277be99790b5de658c71610fc7fb06c0 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Wed, 30 Jan 2013 16:17:38 -0800 Subject: [PATCH 012/127] Update readme with version info. --- doc/README | 57 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/doc/README b/doc/README index c5a6093..ae82ab1 100644 --- a/doc/README +++ b/doc/README @@ -2,11 +2,11 @@ ## ( or: why would I want to relearn how to write specs? ) RSpec Steps allows you to chain examples into a series of steps that run -in sequence and which stop when a step fails. It's often incredibly -useful to be able to aseemble a series of tests that should all pass, +in sequence and which stop when a step fails. It's often incredibly +useful to be able to aseemble a series of tests that should all pass, but where completely isolating them is less than sensible. -One excellent example is web site integration tests. With RSpec steps you can +One excellent example is web site integration tests. With RSpec steps you can do: steps "Login and change password" do @@ -14,42 +14,42 @@ do: visit root page.should have_text "Login" end - + it "should successfully log in" do fill_in :name, "Johnny User" click "Login" page.should have_text "Welcome, Johnny!" end - - it "should load the password change form" do + + it "should load the password change form" do click "My Settings" click "Update Password" page.should have_selector("form#update_password") - end - + end + it "should change the user's password successfully" do fill_in :password, "foobar" fill_in :password_confirmation, "foobar" click "Change Password" page.should have_text "Password changed successfully!" - User.find_by_name("Johnny User").valid_password?("foobar").should be_true + User.find_by_name("Johnny User").valid_password?("foobar").should be_true end - + end The examples above will be run in order. State is preserved between examples -inside a "steps" block: any DB transactions will not roll back until the entire -sequence has been complete. +inside a "steps" block: any DB transactions will not roll back until the entire +sequence has been complete. -If any example inside the "steps" block fails, all remaining steps will be marked -pending and therefore skipped. +If any example inside the "steps" block fails, all remaining steps will be marked +pending and therefore skipped. ## Rationale RSpec's philosophy is that all examples should be completely independent. This -is a great philosophy for most purposes, and we recommend you stick to it in -almost all cases. BUT, that complete separation of examples really sucks when -you're trying to write long stories involving many requests. You are usually +is a great philosophy for most purposes, and we recommend you stick to it in +almost all cases. BUT, that complete separation of examples really sucks when +you're trying to write long stories involving many requests. You are usually stuck with three choices: 1. Write a sequence of examples, each of which repeats the behavior of all previous examples. Downside: horrendously inefficient. @@ -62,13 +62,13 @@ and skip subsequent steps after a failure. ## Caveats and cautions -Don't call "describe" inside of "steps". The behavior is undefined and probably bad. It's -hard to imagine what this should actually mean in any case. Future versions of rspec-steps +Don't call "describe" inside of "steps". The behavior is undefined and probably bad. It's +hard to imagine what this should actually mean in any case. Future versions of rspec-steps will consider this an error. Any call to "before" inside a steps block is treated like before(:all) and is run only -once before the first step. Or perhaps more accurately, any call to before() is treated -like before(:each) ... but for these purposes the entire steps block is treated like a +once before the first step. Or perhaps more accurately, any call to before() is treated +like before(:each) ... but for these purposes the entire steps block is treated like a single example. ## Advanced stuff: shared steps @@ -89,8 +89,8 @@ diverge, you can DRY your code out with shared_steps blocks, like so: end steps "updating password" do - perform_steps "For a logged-in user" - + perform_steps "For a logged-in user" + it "should update the password" do ... end @@ -98,17 +98,20 @@ diverge, you can DRY your code out with shared_steps blocks, like so: steps "uploading a profile picture" do perform_steps "For a logged-in user" - + it "should upload a picture" do ... end end +## Versions and Dependencies + +0.0.8: Released Jan 11, 2012. + NOTES: Will not work with rspec >= 2.8. + + - - - From 40fbe38a79eed0c540b5e370273d30bce2e41db5 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 30 Jan 2013 16:53:46 -0800 Subject: [PATCH 013/127] Local dev, pushed for ED's inspection --- .rspec | 5 +- Gemfile | 1 + Gemfile-2.7 | 6 + Gemfile-2.8 | 6 + Gemfile.lock | 71 ++++++--- Rakefile | 359 +++----------------------------------------- rspec-steps.gemspec | 7 +- 7 files changed, 85 insertions(+), 370 deletions(-) create mode 100644 Gemfile-2.7 create mode 100644 Gemfile-2.8 diff --git a/.rspec b/.rspec index 3089583..863ce69 100644 --- a/.rspec +++ b/.rspec @@ -1,6 +1,5 @@ ---format documentation ---out last_run -I /home/judson/ruby/gems/rspec-steps/spec_help/interpose -I /home/judson/ruby/gems/rspec-steps/lib -I /home/judson/ruby/gems/rspec-steps/spec_help ---require spec_helper \ No newline at end of file +--require spec_helper +--pattern *.rb diff --git a/Gemfile b/Gemfile index 2950e80..61ee5ac 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,5 @@ source "http://lrdesign:quiS6Nef@gems.lrdesign.com" source "http://gemcutter.org" source "http://gems.github.com" +gem 'rspec', "~> 2.8.0" gemspec diff --git a/Gemfile-2.7 b/Gemfile-2.7 new file mode 100644 index 0000000..03ab3b3 --- /dev/null +++ b/Gemfile-2.7 @@ -0,0 +1,6 @@ +source "http://lrdesign:quiS6Nef@gems.lrdesign.com" +source "http://gemcutter.org" +source "http://gems.github.com" + +gem 'rspec', "~> 2.7.0" +gemspec diff --git a/Gemfile-2.8 b/Gemfile-2.8 new file mode 100644 index 0000000..61ee5ac --- /dev/null +++ b/Gemfile-2.8 @@ -0,0 +1,6 @@ +source "http://lrdesign:quiS6Nef@gems.lrdesign.com" +source "http://gemcutter.org" +source "http://gems.github.com" + +gem 'rspec', "~> 2.8.0" +gemspec diff --git a/Gemfile.lock b/Gemfile.lock index dc90c15..4edee1e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.0.6) + rspec-steps (0.0.8) rspec (>= 2.6) GEM @@ -9,37 +9,60 @@ GEM remote: http://gemcutter.org/ remote: http://gems.github.com/ specs: - diff-lcs (1.1.2) - haml (2.2.24) - hanna (0.1.12) - haml (~> 2.2.8) - rake (~> 0.8.2) - rdoc (~> 2.3.0) + chunky_png (1.2.5) + compass (0.12.1) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (~> 3.1) + corundum (0.0.17) + bundler (~> 1.1.0) + compass (>= 0.12.1) + mailfactory (~> 1.4.0) + mattock (>= 0.2.11) + nokogiri + rake-rubygems (>= 0.2.0) + rdoc + rspec (>= 2.0) + sass (>= 3.1) + simplecov (>= 0.5.4) + yard + diff-lcs (1.1.3) + fssm (0.2.9) + json (1.7.3) mailfactory (1.4.0) mime-types (>= 1.13.1) - mime-types (1.16) - rake (0.8.7) + mattock (0.2.12) + tilt (> 0) + valise (>= 0.6) + mime-types (1.18) + multi_json (1.3.5) + nokogiri (1.5.2) + rake (0.9.2.2) rake-rubygems (0.2.0) rake (>= 0.8.7) - rcov (0.9.9) - rdoc (2.3.0) - rspec (2.6.0) - rspec-core (~> 2.6.0) - rspec-expectations (~> 2.6.0) - rspec-mocks (~> 2.6.0) - rspec-core (2.6.4) - rspec-expectations (2.6.0) + rdoc (3.12) + json (~> 1.4) + rspec (2.8.0) + rspec-core (~> 2.8.0) + rspec-expectations (~> 2.8.0) + rspec-mocks (~> 2.8.0) + rspec-core (2.8.0) + rspec-expectations (2.8.0) diff-lcs (~> 1.1.2) - rspec-mocks (2.6.0) + rspec-mocks (2.8.0) + sass (3.1.18) + simplecov (0.6.4) + multi_json (~> 1.0) + simplecov-html (~> 0.5.3) + simplecov-html (0.5.3) + tilt (1.3.3) + valise (0.6) + yard (0.8.1) PLATFORMS ruby DEPENDENCIES - bundler (~> 1.0.0) - hanna (~> 0.1.0) - mailfactory (~> 1.4.0) - rake-rubygems (>= 0.2.0) - rcov - rspec (>= 2.0) + corundum (>= 0.0.13) + rspec (~> 2.8.0) rspec-steps! diff --git a/Rakefile b/Rakefile index 8b00218..d4cfc8d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,347 +1,32 @@ -require 'rubygems' -require 'rubygems/installer' -require 'rake/gempackagetask' -require 'rake/rubygems' -require 'hanna/rdoctask' -require 'rspec/core/rake_task' -require 'mailfactory' -require 'net/smtp' +require 'corundum/tasklibs' +require 'mattock/yard_extensions' -begin - speclist = Dir[File.expand_path(__FILE__ +'/../*.gemspec')] - if speclist.length == 0 - puts "Found no *.gemspec files" - exit 1 - else if speclist.length > 1 - puts "Found too many *.gemspec files: #{speclist.inspect}" - exit 1 - end - - spec = Gem::Specification::load(speclist[0]) - RakeConfig = { - :gemspec => spec, - :gemspec_path => speclist[0], - :package_dir => "pkg", - :rcov_threshold => 80, - :email => { - :servers => [ { - :server => "ruby-lang.org", - :helo => "gmail.com" - } ], - :announce_to_email => "ruby-talk@ruby-lang.org", - }, - :files => { - :code => spec.files.grep(%r{^lib/}), - :test => spec.files.grep(%r{^spec/}), - :docs => spec.files.grep(%r{^doc/}) - }, - :rubyforge => { - :group_id => spec.rubyforge_project, - :package_id => spec.name.downcase, - :release_name => spec.full_name, - :home_page => spec.homepage, - :project_page => "http://rubyforge.org/project/#{spec.rubyforge_project}/" - } - } -end - -directory "doc" -directory RakeConfig[:package_dir] - -class SpecTask < RSpec::Core::RakeTask - def initialize(name=:spec) - super(name) do - @ruby_opts = [] - @rspec_opts= %w{-f d --out last_run --color} - @rcov_opts = %w{--exclude ^rcov/,[^/]*\.gemspec,^spec/,^spec_help/ --sort coverage --threshold 101 -o doc/coverage --xrefs --no-color} - @rcov = true - @warning = false #bundler raises lots of warnings :/ - @failure_message = "Spec examples failed." - @files_to_run = FileList['spec/**/*.rb'] - yield(self) if block_given? - end - task name => ".rspec" - end - - attr_accessor :files_to_run - - def spec_command - @spec_command ||= - begin - cmd_parts = [*ruby_opts] - cmd_parts << "-w" if warning? - cmd_parts << "-S" - cmd_parts << "bundle exec" if gemfile? unless skip_bundler - - if rcov - cmd_parts += [*rcov_path] - cmd_parts += ["-Ispec_help#{File::PATH_SEPARATOR}spec#{File::PATH_SEPARATOR}lib", *rcov_opts] - cmd_parts += ["spec_help/spec_helper.rb", *files_to_run ] - unless @rspec_opts.nil? or @rspec_opts.empty? - cmd_parts << "--" - cmd_parts += [*@rspec_opts] - end - else - cmd_parts += [*rspec_path] - cmd_parts += [*@rspec_opts] - cmd_parts += [*files_to_run] - end +module Corundum + register_project(__FILE__) - - cmd_parts.compact.join(" ").tap{|o| p o} - end - end -end - -task :needs_root do - unless Process::uid == 0 - fail "This task must be run as root" - - exit { - unless (user = ENV['SUDO_USER']).nil? - FileUtils::chown_R(user, ENV['SUDO_GID'].to_i, 'doc/coverage') - end - } + tk = Toolkit.new do |tk| + tk.file_lists.project = [__FILE__] end -end - -desc "Run failing examples if any exist, otherwise, run the whole suite" -task :rspec => "rspec:quick" -namespace :rspec do - file "doc/coverage/index.html" => FileList['spec/**/*.rb', 'lib/**/*.rb'] do - Rake::Task['rspec:doc'].invoke - end - - desc "Generate default .rspec file" - file ".rspec" => ["Rakefile", RakeConfig[:gemspec_path]] do |t| - options = [ - "--format documentation", - "--out last_run", - ] - [%w{spec_help interpose}, %w{lib}, %w{spec_help}].map do|dir| - options << "-I #{ File::join(File::dirname(__FILE__), *dir)}" + tk.in_namespace do + sanity = GemspecSanity.new(tk) + rspec = RSpec.new(tk) + cov = SimpleCov.new(tk, rspec) do |cov| + cov.threshold = 55 end - options << "--require spec_helper" - File.open(t.name, "w") do |rspec| - rspec.write(options.join("\n")) + gem = GemBuilding.new(tk) + cutter = GemCutter.new(tk,gem) + email = Email.new(tk) + vc = Git.new(tk) do |vc| + vc.branch = "master" end - end - - desc "Always run every spec" - SpecTask.new(:all) - - desc "Generate specifications documentation" - SpecTask.new(:doc) do |t| - t.rspec_opts = %w{-f s -o doc/Specifications} - t.failure_message = "Failed generating specification docs" - t.verbose = false - end - - desc "Run specs with Ruby profiling" - SpecTask.new(:profile) do |t| - t.ruby_opts += %w{-rprofile} - end - - desc "Run only failing examples" - SpecTask.new(:quick) do |t| - t.rspec_opts += %w{-f d --color} - examples = [] - begin - File.open("last_run", "r") do |fail_list| - fail_list.lines.grep(%r{^\s*\d+\)\s*(.*)}) do |line| - examples << $1.gsub(/'/){"[']"} - end - end - rescue - end - unless examples.empty? - t.rspec_opts << "--example" - t.rspec_opts << "\"#{examples.join("|")}\"" + task tk.finished_files.build => vc["is_checked_in"] + yd = YARDoc.new(tk) do |yd| + yd.extra_files = ["Rakefile.rb"] end - t.rcov = false - t.failure_message = "Spec examples failed." - end - - desc "Run rspecs prior to a package publication" - SpecTask.new(:check) do |t| - t.rspec_opts = %w{--format p --out /dev/null} - t.failure_message = "Package does not conform to spec" - t.verbose = false - end - - desc "Open chromium to view RCov output" - task :view_coverage => "doc/coverage/index.html" do |t| - sh "/usr/bin/chromium doc/coverage/index.html" + all_docs = DocumentationAssembly.new(tk, yd, rspec, cov) + pages = GithubPages.new(all_docs) end end -namespace :qa do - desc "Confirm code quality - e.g. before shipping" - task :sign_off => %w{verify_rcov compare:coverage_and_manifest} - - desc "Confirm a minimum code coverage" - task :verify_rcov => "doc/coverage/index.html" do - require 'nokogiri' - - doc = Nokogiri::parse(File::read('doc/coverage/index.html')) - percentage = doc.xpath("//tt[@class='coverage_total']").first.content.to_f - raise "Coverage must be at least #{RakeConfig[:rcov_threshold]} but was #{percentage}" if percentage < RakeConfig[:rcov_threshold] - puts "Coverage is #{percentage}% (required: #{RakeConfig[:rcov_threshold]}%)" - end - - namespace :compare do - desc "Ensure that all code files being shipped are covered" - task :coverage_and_manifest => "doc/coverage/index.html" do - require 'nokogiri' - - doc = Nokogiri::parse(File::read('doc/coverage/index.html')) - covered_files = [] - doc.xpath("//table[@id='report_table']//td//a").each do |link| - covered_files << link.content - end - not_listed = covered_files - RakeConfig[:files][:code] - not_covered = RakeConfig[:files][:code] - covered_files - unless not_listed.empty? and not_covered.empty? - raise ["Covered files and gemspec manifest don't match:", - "Not in gemspec: #{not_listed.inspect}", - "Not covered: #{not_covered.inspect}"].join("\n") - end - end - end -end - -Rake::Gemcutter::Tasks.new(RakeConfig[:gemspec]) -namespace :gem do - task :push => %w{qa:sign_off package} - task :install => [:needs_root, 'qa:sign_off'] - task :reinstall => [:needs_root, 'qa:sign_off'] - - package = Rake::GemPackageTask.new(RakeConfig[:gemspec]) {|t| - t.need_tar_gz = true - t.need_tar_bz2 = true - } - task(:package).prerequisites.each do |package_type| - file package_type => "rspec:check" - end - - Rake::RDocTask.new(:docs) do |rd| - rd.options += RakeConfig[:gemspec].rdoc_options - rd.rdoc_dir = 'rubydoc' - rd.rdoc_files.include(RakeConfig[:files][:code]) - rd.rdoc_files.include(RakeConfig[:files][:docs]) - rd.rdoc_files += (RakeConfig[:gemspec].extra_rdoc_files) - end - task :docs => ['rspec:doc'] -end - -task :gem => "gem:gem" - -desc "Publish the gem and its documentation to Rubyforge and Gemcutter" -task :publish => ['publish:docs', 'publish:rubyforge', 'gem:push'] - -namespace :publish do - desc 'Publish RDoc to RubyForge' - task :docs => 'gem:docs' do - config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml"))) - host = "#{config["username"]}@rubyforge.org" - remote_dir = "/var/www/gforge-projects/#{RakeConfig[:rubyforge][:group_id]}" - local_dir = 'rubydoc' - sh %{rsync -av --delete #{local_dir}/ #{host}:#{remote_dir}} - end - - task :scrape_rubyforge do - require 'rubyforge' - forge = RubyForge.new - forge.configure - forge.scrape_project(RakeConfig[:rubyforge][:package_id]) - end - - desc "Publishes to RubyForge" - task :rubyforge => ['qa:sign_off', 'gem:package', :docs, :scrape_rubyforge] do |t| - require 'rubyforge' - forge = RubyForge.new - forge.configure - files = [".gem", ".tar.gz", ".tar.bz2"].map do |extension| - File::join(RakeConfig[:package_dir], RakeConfig[:gemspec].full_name) + extension - end - release = forge.lookup("release", RakeConfig[:rubyforge][:package_id])[RakeConfig[:rubyforge][:release_name]] rescue nil - if release.nil? - forge.add_release(RakeConfig[:rubyforge][:group_id], RakeConfig[:rubyforge][:package_id], RakeConfig[:rubyforge][:release_name], *files) - else - files.each do |file| - forge.add_file(RakeConfig[:rubyforge][:group_id], RakeConfig[:rubyforge][:package_id], RakeConfig[:rubyforge][:release_name], file) - end - end - end -end - -def announcement - changes = "" - begin - File::open("./Changelog", "r") do |changelog| - changes = "Changes:\n\n" - changes += changelog.read - end - rescue Exception - end - - urls = "Project: #{RakeConfig[:rubyforge][:project_page]}\n" + - "Homepage: #{RakeConfig[:rubyforge][:home_page]}" - - subject = "#{RakeConfig[:gemspec].name} #{RakeConfig[:gemspec].version} Released" - title = "#{RakeConfig[:gemspec].name} version #{RakeConfig[:gemspec].version} has been released!" - body = "#{RakeConfig[:gemspec].description}\n\n#{changes}\n\n#{urls}" - - return subject, title, body -end - -desc 'Announce release on RubyForge and email' -task :press => ['press:rubyforge', 'press:email'] -namespace :press do - desc 'Post announcement to rubyforge.' - task :rubyforge do - require 'rubyforge' - subject, title, body = announcement - - forge = RubyForge.new - forge.configure - forge.post_news(RakeConfig[:rubyforge][:group_id], subject, "#{title}\n\n#{body}") - puts "Posted to rubyforge" - end - - file "email.txt" do |t| - subject, title, body= announcement - - mail = MailFactory.new - mail.To = RakeConfig[:announce_to_email] - mail.From = RakeConfig[:gemspec].email - mail.Subject = "[ANN] " + subject - mail.text = [title, body].join("\n\n") - - File.open(t.name, "w") do |mailfile| - mailfile.write mail.to_s - end - end - - desc 'Generate email announcement file.' - task :email => "email.txt" do - require 'rubyforge' - - RakeConfig[:email_servers].each do |server_config| - begin - File::open("email.txt", "r") do |email| - Net::SMTP.start(server_config[:server], 25, server_config[:helo], server_config[:username], server_config[:password]) do |smtp| - smtp.data do |mta| - mta.write(email.read) - end - end - end - break - rescue Object => ex - puts ex.message - end - end - end -end -end +task :default => [:release, :publish_docs] diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 3783f09..6c7ce4d 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -42,12 +42,7 @@ Gem::Specification.new do |spec| spec.rubygems_version = "1.3.5" dev_deps = [ - ["rake-rubygems", ">= 0.2.0"], - ["hanna", "~> 0.1.0"], - ["mailfactory", "~> 1.4.0"], - ["rspec", [">= 2.0"]], - ["bundler", ["~> 1.0.0"]], - ["rcov", [">= 0"]] + ["corundum", ">= 0.0.13"], ] if spec.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION From f4640cf53c7825459a60d36d151e39d1cdce8577 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Wed, 30 Jan 2013 17:10:03 -0800 Subject: [PATCH 014/127] Update Corundum dependency and change .rspec paths to relative --- .rspec | 6 +++--- Gemfile.lock | 38 +++++++++++++++++++------------------- rspec-steps.gemspec | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.rspec b/.rspec index 863ce69..175ff48 100644 --- a/.rspec +++ b/.rspec @@ -1,5 +1,5 @@ --I /home/judson/ruby/gems/rspec-steps/spec_help/interpose --I /home/judson/ruby/gems/rspec-steps/lib --I /home/judson/ruby/gems/rspec-steps/spec_help +-I ./spec_help/interpose +-I ./lib +-I ./spec_help --require spec_helper --pattern *.rb diff --git a/Gemfile.lock b/Gemfile.lock index 4edee1e..160c661 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,16 +9,16 @@ GEM remote: http://gemcutter.org/ remote: http://gems.github.com/ specs: - chunky_png (1.2.5) - compass (0.12.1) + chunky_png (1.2.7) + compass (0.12.2) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) - corundum (0.0.17) - bundler (~> 1.1.0) + corundum (0.0.25) + bundler compass (>= 0.12.1) mailfactory (~> 1.4.0) - mattock (>= 0.2.11) + mattock (>= 0.3.0) nokogiri rake-rubygems (>= 0.2.0) rdoc @@ -27,17 +27,17 @@ GEM simplecov (>= 0.5.4) yard diff-lcs (1.1.3) - fssm (0.2.9) - json (1.7.3) + fssm (0.2.10) + json (1.7.6) mailfactory (1.4.0) mime-types (>= 1.13.1) - mattock (0.2.12) + mattock (0.3.4) tilt (> 0) valise (>= 0.6) - mime-types (1.18) - multi_json (1.3.5) - nokogiri (1.5.2) - rake (0.9.2.2) + mime-types (1.19) + multi_json (1.5.0) + nokogiri (1.5.6) + rake (10.0.3) rake-rubygems (0.2.0) rake (>= 0.8.7) rdoc (3.12) @@ -50,19 +50,19 @@ GEM rspec-expectations (2.8.0) diff-lcs (~> 1.1.2) rspec-mocks (2.8.0) - sass (3.1.18) - simplecov (0.6.4) + sass (3.2.5) + simplecov (0.7.1) multi_json (~> 1.0) - simplecov-html (~> 0.5.3) - simplecov-html (0.5.3) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) tilt (1.3.3) - valise (0.6) - yard (0.8.1) + valise (0.8.2) + yard (0.8.3) PLATFORMS ruby DEPENDENCIES - corundum (>= 0.0.13) + corundum (>= 0.0.25) rspec (~> 2.8.0) rspec-steps! diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 6c7ce4d..aa336d9 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -42,7 +42,7 @@ Gem::Specification.new do |spec| spec.rubygems_version = "1.3.5" dev_deps = [ - ["corundum", ">= 0.0.13"], + ["corundum", ">= 0.0.25"], ] if spec.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION From b929778af3e023dd8504935d60c8e00b58c17d10 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Wed, 30 Jan 2013 18:21:06 -0800 Subject: [PATCH 015/127] unfinished work on 2.10 compatibility --- Gemfile | 2 +- Gemfile.lock | 18 +++++++++--------- doc/README | 2 +- lib/rspec-steps/stepwise.rb | 12 ++++++++++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index 61ee5ac..eb236b4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,5 @@ source "http://lrdesign:quiS6Nef@gems.lrdesign.com" source "http://gemcutter.org" source "http://gems.github.com" -gem 'rspec', "~> 2.8.0" +gem 'rspec', "~> 2.10.0" gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 160c661..b0dfab9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,14 +42,14 @@ GEM rake (>= 0.8.7) rdoc (3.12) json (~> 1.4) - rspec (2.8.0) - rspec-core (~> 2.8.0) - rspec-expectations (~> 2.8.0) - rspec-mocks (~> 2.8.0) - rspec-core (2.8.0) - rspec-expectations (2.8.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.8.0) + rspec (2.10.0) + rspec-core (~> 2.10.0) + rspec-expectations (~> 2.10.0) + rspec-mocks (~> 2.10.0) + rspec-core (2.10.1) + rspec-expectations (2.10.0) + diff-lcs (~> 1.1.3) + rspec-mocks (2.10.1) sass (3.2.5) simplecov (0.7.1) multi_json (~> 1.0) @@ -64,5 +64,5 @@ PLATFORMS DEPENDENCIES corundum (>= 0.0.25) - rspec (~> 2.8.0) + rspec (~> 2.10.0) rspec-steps! diff --git a/doc/README b/doc/README index ae82ab1..8ed8df3 100644 --- a/doc/README +++ b/doc/README @@ -107,7 +107,7 @@ diverge, you can DRY your code out with shared_steps blocks, like so: ## Versions and Dependencies 0.0.8: Released Jan 11, 2012. - NOTES: Will not work with rspec >= 2.8. + NOTES: Will not work with rspec > 2.9. diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 0e255f0..9a4c24a 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -49,7 +49,11 @@ def run_before_all_hooks(example_group_instance) def stepped_before_hooks(example_group_instance) example_group_instance.example = whole_list_example - world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) + if world.respond_to?(:run_hook_filtered) # Rspec < 2.10 + world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) + else # Rspec >= 2.10 + self.run_hook(:before, :each, example_group_instance) + end ancestors.reverse.each { |ancestor| ancestor.run_hook(:before, :each, example_group_instance) } store_before_all_ivars(example_group_instance) end @@ -79,7 +83,11 @@ def run_after_all_hooks(example_group_instance) def stepped_after_hooks(example_group_instance) example_group_instance.example = whole_list_example ancestors.each { |ancestor| ancestor.run_hook(:after, :each, example_group_instance) } - world.run_hook_filtered(:after, :each, self, example_group_instance, whole_list_example) + if world.respond_to?(:run_hook_filtered) # Rspec < 2.10 + world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) + else # Rspec >= 2.10 + self.run_hook(:before, :each, example_group_instance) + end end def whole_list_example From 922de7fdb495143c0bef5a7bd86d86fd3774f421 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Thu, 31 Jan 2013 17:54:27 -0800 Subject: [PATCH 016/127] Fixes to add compatibility with rspec-core 2.10.x. --- Gemfile.lock | 16 ++++++++-------- doc/README | 4 ++++ lib/rspec-steps/stepwise.rb | 12 +++++++++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b0dfab9..d52cd17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,14 +42,14 @@ GEM rake (>= 0.8.7) rdoc (3.12) json (~> 1.4) - rspec (2.10.0) - rspec-core (~> 2.10.0) - rspec-expectations (~> 2.10.0) - rspec-mocks (~> 2.10.0) - rspec-core (2.10.1) - rspec-expectations (2.10.0) + rspec (2.12.0) + rspec-core (~> 2.12.0) + rspec-expectations (~> 2.12.0) + rspec-mocks (~> 2.12.0) + rspec-core (2.12.2) + rspec-expectations (2.12.1) diff-lcs (~> 1.1.3) - rspec-mocks (2.10.1) + rspec-mocks (2.12.2) sass (3.2.5) simplecov (0.7.1) multi_json (~> 1.0) @@ -64,5 +64,5 @@ PLATFORMS DEPENDENCIES corundum (>= 0.0.25) - rspec (~> 2.10.0) + rspec (~> 2.12.0) rspec-steps! diff --git a/doc/README b/doc/README index 8ed8df3..7d800ac 100644 --- a/doc/README +++ b/doc/README @@ -109,6 +109,10 @@ diverge, you can DRY your code out with shared_steps blocks, like so: 0.0.8: Released Jan 11, 2012. NOTES: Will not work with rspec > 2.9. +CURRENT UNRELEASED Jan 31 2013: + Specs pass with rspec-core 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.1 + Specs fail with rspec-core 2.11.x + diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 9a4c24a..9f65ce6 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -49,10 +49,11 @@ def run_before_all_hooks(example_group_instance) def stepped_before_hooks(example_group_instance) example_group_instance.example = whole_list_example + if world.respond_to?(:run_hook_filtered) # Rspec < 2.10 world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) else # Rspec >= 2.10 - self.run_hook(:before, :each, example_group_instance) + run_hook(:before, :each, whole_list_example) end ancestors.reverse.each { |ancestor| ancestor.run_hook(:before, :each, example_group_instance) } store_before_all_ivars(example_group_instance) @@ -86,7 +87,7 @@ def stepped_after_hooks(example_group_instance) if world.respond_to?(:run_hook_filtered) # Rspec < 2.10 world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) else # Rspec >= 2.10 - self.run_hook(:before, :each, example_group_instance) + run_hook(:before, :each, whole_list_example) end end @@ -97,7 +98,12 @@ def whole_list_example end def with_around_hooks(instance, &block) - hooks = around_hooks_for(self) + if self.respond_to?(:around_hooks_for) # rSpec < 2.10.0 + hooks = around_hooks_for(self) + else + hooks = around_each_hooks_for(self) # rSpec >= 2.10.0 + end + if hooks.empty? yield else From 103d7dd80b7d71364fdf68ceba91751fedc8789a Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 21 Feb 2013 23:35:57 -0800 Subject: [PATCH 017/127] Some Gemfile changes --- Gemfile | 4 ++-- Gemfile.lock | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index eb236b4..c0552b6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "http://lrdesign:quiS6Nef@gems.lrdesign.com" -source "http://gemcutter.org" -source "http://gems.github.com" +source :rubygems gem 'rspec', "~> 2.10.0" +gem 'fuubar' gemspec diff --git a/Gemfile.lock b/Gemfile.lock index d52cd17..5eac6f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,8 +6,7 @@ PATH GEM remote: http://lrdesign:quiS6Nef@gems.lrdesign.com/ - remote: http://gemcutter.org/ - remote: http://gems.github.com/ + remote: http://rubygems.org/ specs: chunky_png (1.2.7) compass (0.12.2) @@ -28,6 +27,10 @@ GEM yard diff-lcs (1.1.3) fssm (0.2.10) + fuubar (1.0.0) + rspec (~> 2.0) + rspec-instafail (~> 0.2.0) + ruby-progressbar (~> 0.0.10) json (1.7.6) mailfactory (1.4.0) mime-types (>= 1.13.1) @@ -42,14 +45,16 @@ GEM rake (>= 0.8.7) rdoc (3.12) json (~> 1.4) - rspec (2.12.0) - rspec-core (~> 2.12.0) - rspec-expectations (~> 2.12.0) - rspec-mocks (~> 2.12.0) - rspec-core (2.12.2) - rspec-expectations (2.12.1) + rspec (2.10.0) + rspec-core (~> 2.10.0) + rspec-expectations (~> 2.10.0) + rspec-mocks (~> 2.10.0) + rspec-core (2.10.1) + rspec-expectations (2.10.0) diff-lcs (~> 1.1.3) - rspec-mocks (2.12.2) + rspec-instafail (0.2.4) + rspec-mocks (2.10.1) + ruby-progressbar (0.0.10) sass (3.2.5) simplecov (0.7.1) multi_json (~> 1.0) @@ -64,5 +69,6 @@ PLATFORMS DEPENDENCIES corundum (>= 0.0.25) - rspec (~> 2.12.0) + fuubar + rspec (~> 2.10.0) rspec-steps! From 0c4d19b59a3bc2162c8b2ce956bac69d3e45cc4c Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 21 Feb 2013 23:39:53 -0800 Subject: [PATCH 018/127] Making ready for 0.0.9 release --- .gitignore | 1 + .simplecov | 4 ++++ Gemfile.lock | 2 +- rspec-steps.gemspec | 6 ++---- 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .simplecov diff --git a/.gitignore b/.gitignore index 5ff3450..5dbe7d5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ pkg *.sw? rspec-steps-*.gem .bundle +corundum/ diff --git a/.simplecov b/.simplecov new file mode 100644 index 0000000..a8cc950 --- /dev/null +++ b/.simplecov @@ -0,0 +1,4 @@ +SimpleCov.start do + coverage_dir "corundum/docs/coverage" + add_filter "./spec" +end diff --git a/Gemfile.lock b/Gemfile.lock index 5eac6f6..57ec895 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.0.8) + rspec-steps (0.0.9) rspec (>= 2.6) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index aa336d9..82940ee 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.0.8" + spec.version = "0.0.9" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| lib/rspec-steps/duckpunch/object-extensions.rb doc/README doc/Specifications - spec/example_group.rb + spec/example_group_spec.rb spec_help/spec_helper.rb spec_help/gem_test_suite.rb spec_help/rspec-sandbox.rb @@ -73,5 +73,3 @@ Gem::Specification.new do |spec| spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" end - - From 7dc250c1b98cb5e284c30a918b987649d18478cc Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Wed, 6 Mar 2013 16:44:31 -0800 Subject: [PATCH 019/127] Added gemfile for rspec 2.10 --- Gemfile-2.10 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Gemfile-2.10 diff --git a/Gemfile-2.10 b/Gemfile-2.10 new file mode 100644 index 0000000..eb236b4 --- /dev/null +++ b/Gemfile-2.10 @@ -0,0 +1,6 @@ +source "http://lrdesign:quiS6Nef@gems.lrdesign.com" +source "http://gemcutter.org" +source "http://gems.github.com" + +gem 'rspec', "~> 2.10.0" +gemspec From 4f3bba385dcccdf5f6cca1e9689f5ac736fa96da Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Wed, 6 Mar 2013 16:53:55 -0800 Subject: [PATCH 020/127] Readme note about compatibility --- doc/README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/README b/doc/README index 7d800ac..6a0e5b8 100644 --- a/doc/README +++ b/doc/README @@ -106,6 +106,9 @@ diverge, you can DRY your code out with shared_steps blocks, like so: ## Versions and Dependencies +0.0.9: Released Feb 22, 2013. + NOTES: works with rspec 2.6 through 2.10. Does not work with rspec >= 2.11 + 0.0.8: Released Jan 11, 2012. NOTES: Will not work with rspec > 2.9. From a8f733d485ee0ffcc640afe4957c250aa2b8b07c Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 12 Mar 2013 17:52:45 -0700 Subject: [PATCH 021/127] Compatibile with 2.13 --- lib/rspec-steps/duckpunch/example-group.rb | 7 +- lib/rspec-steps/stepwise.rb | 164 ++++++++------------- 2 files changed, 65 insertions(+), 106 deletions(-) diff --git a/lib/rspec-steps/duckpunch/example-group.rb b/lib/rspec-steps/duckpunch/example-group.rb index 85068e9..591cb18 100644 --- a/lib/rspec-steps/duckpunch/example-group.rb +++ b/lib/rspec-steps/duckpunch/example-group.rb @@ -4,7 +4,12 @@ module RSpec::Steps module ClassMethods def steps(*args, &block) - options = if args.last.is_a?(Hash) then args.pop else {} end + options = + if args.last.is_a?(Hash) + args.pop + else + {} + end options[:stepwise] = true options[:caller] ||= caller args.push(options) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 9f65ce6..2cfc81d 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -1,15 +1,63 @@ module RSpecStepwise + class WholeListExample < RSpec::Core::Example + def initialize(example_group_class, descriptions, metadata) + super + build_example_block + end + + def start(reporter) + end + + def finish(reporter) + end + + def build_example_block + #variables of concern: reporter, instance + @example_block = proc do + begin + self.class.filtered_examples.inject(true) do |success, example| + break if RSpec.wants_to_quit + example.extend StepExample + unless success + example.metadata[:pending] = true + example.metadata[:execution_result][:pending_message] = "Previous step failed" + end + succeeded = with_indelible_ivars do + example.run(self, reporter) + end + RSpec.wants_to_quit = true if self.class.fail_fast? && !succeeded + success && succeeded + end + end + end + end + end + + module StepExample + def run_before_each + end + + def run_after_each + end + + def with_around_hooks + yield + end + end + module ClassMethods #TODO: This is hacky and needs a more general solution #Something like cloning the current conf and having RSpec::Stepwise::config ? def suspend_transactional_fixtures if self.respond_to? :use_transactional_fixtures - old_val = self.use_transactional_fixtures - self.use_transactional_fixtures = false + begin + old_val = self.use_transactional_fixtures + self.use_transactional_fixtures = false - yield - - self.use_transactional_fixtures = old_val + yield + ensure + self.use_transactional_fixtures = old_val + end else yield end @@ -36,85 +84,6 @@ def around(*args, &block) super end - - def eval_before_alls(example_group_instance) - super - stepped_before_hooks(example_group_instance) - end - - def run_before_all_hooks(example_group_instance) - super - stepped_before_hooks(example_group_instance) - end - - def stepped_before_hooks(example_group_instance) - example_group_instance.example = whole_list_example - - if world.respond_to?(:run_hook_filtered) # Rspec < 2.10 - world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) - else # Rspec >= 2.10 - run_hook(:before, :each, whole_list_example) - end - ancestors.reverse.each { |ancestor| ancestor.run_hook(:before, :each, example_group_instance) } - store_before_all_ivars(example_group_instance) - end - - def eval_around_eachs(example) - end - alias run_around_each_hooks eval_around_eachs - - def eval_before_eachs(example) - end - alias run_before_each_hooks eval_before_eachs - - def eval_after_eachs(example) - end - alias run_after_each_hooks eval_after_eachs - - def eval_after_alls(example_group_instance) - stepped_after_hooks(example_group_instance) - super - end - - def run_after_all_hooks(example_group_instance) - stepped_after_hooks(example_group_instance) - super - end - - def stepped_after_hooks(example_group_instance) - example_group_instance.example = whole_list_example - ancestors.each { |ancestor| ancestor.run_hook(:after, :each, example_group_instance) } - if world.respond_to?(:run_hook_filtered) # Rspec < 2.10 - world.run_hook_filtered(:before, :each, self, example_group_instance, whole_list_example) - else # Rspec >= 2.10 - run_hook(:before, :each, whole_list_example) - end - end - - def whole_list_example - @whole_list_example ||= begin - RSpec::Core::Example.new(self, "step list", {}) - end - end - - def with_around_hooks(instance, &block) - if self.respond_to?(:around_hooks_for) # rSpec < 2.10.0 - hooks = around_hooks_for(self) - else - hooks = around_each_hooks_for(self) # rSpec >= 2.10.0 - end - - if hooks.empty? - yield - else - hooks.reverse.inject(Example.procsy(metadata)) do |procsy, around_hook| - Example.procsy(procsy.metadata) do - instance.instance_eval_with_args(procsy, &around_hook) - end - end.call - end - end - def perform_steps(name, *args, &customization_block) shared_block = world.shared_example_groups[name] raise "Could not find shared example group named \#{name.inspect}" unless shared_block @@ -124,36 +93,21 @@ def perform_steps(name, *args, &customization_block) end def run_examples(reporter) - instance = new + whole_list_example = WholeListExample.new(self, "step list", {}) + instance = new set_ivars(instance, before_all_ivars) - instance.example = whole_list_example + instance.reporter = reporter suspend_transactional_fixtures do - with_around_hooks(instance) do - filtered_examples.inject(true) do |success, example| - break if RSpec.wants_to_quit - unless success - reporter.example_started(example) - example.metadata[:pending] = true - example.metadata[:execution_result][:pending_message] = "Previous step failed" - example.metadata[:execution_result][:started_at] = Time.now - example.instance_eval{ record_finished :pending, :pending_message => "Previous step failed" } - reporter.example_pending(example) - next - end - succeeded = instance.with_indelible_ivars do - example.run(instance, reporter) - end - RSpec.wants_to_quit = true if fail_fast? && !succeeded - success && succeeded - end - end + whole_list_example.run(instance, reporter) end end end + attr_accessor :reporter + def with_indelible_ivars old_value, @ivars_indelible = @ivars_indelible, true result = yield From 1fae0d6ae508f4a924cff5c163ad760465c51111 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 12 Mar 2013 18:10:40 -0700 Subject: [PATCH 022/127] Version bump to 0.1 --- Gemfile.lock | 4 ++-- rspec-steps.gemspec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 57ec895..1e0d3a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - rspec-steps (0.0.9) - rspec (>= 2.6) + rspec-steps (0.1.0) + rspec (>= 2.6, < 2.14.0) GEM remote: http://lrdesign:quiS6Nef@gems.lrdesign.com/ diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 82940ee..7e2298c 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.0.9" + spec.version = "0.1.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" @@ -69,7 +69,7 @@ Gem::Specification.new do |spec| spec.rdoc_options += %w{--main doc/README } spec.rdoc_options += ["--title", "#{spec.name}-#{spec.version} RDoc"] - spec.add_dependency("rspec", ">= 2.6") + spec.add_dependency("rspec", ">= 2.6", "< 2.14.0") spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" end From d35cd4c5800773e37504b83b9a813a839034a92a Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 12 Mar 2013 18:13:33 -0700 Subject: [PATCH 023/127] Updated docs --- doc/README | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/doc/README b/doc/README index 6a0e5b8..28a948f 100644 --- a/doc/README +++ b/doc/README @@ -106,19 +106,11 @@ diverge, you can DRY your code out with shared_steps blocks, like so: ## Versions and Dependencies +0.1.0: Released Mar 12, 2013. + Compatible with RSpec 2.10-2.13 - probably works with earlier versions + 0.0.9: Released Feb 22, 2013. NOTES: works with rspec 2.6 through 2.10. Does not work with rspec >= 2.11 0.0.8: Released Jan 11, 2012. NOTES: Will not work with rspec > 2.9. - -CURRENT UNRELEASED Jan 31 2013: - Specs pass with rspec-core 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.1 - Specs fail with rspec-core 2.11.x - - - - - - - From 54d9aa436432ef6a2be788c85a499c1433f2a95f Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 12 Mar 2013 18:16:00 -0700 Subject: [PATCH 024/127] Fix for Rakefile and doc generation --- .gitignore | 3 +++ Rakefile | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5dbe7d5..82f9fda 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ pkg rspec-steps-*.gem .bundle corundum/ +.sass-cache/ +.yardoc/ +gh-pages/ diff --git a/Rakefile b/Rakefile index d4cfc8d..ee781a5 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,6 @@ module Corundum end task tk.finished_files.build => vc["is_checked_in"] yd = YARDoc.new(tk) do |yd| - yd.extra_files = ["Rakefile.rb"] end all_docs = DocumentationAssembly.new(tk, yd, rspec, cov) pages = GithubPages.new(all_docs) From bae7c2ec7e06c427c1fe794543ea4cbab70a026f Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 6 Nov 2013 13:06:34 -0800 Subject: [PATCH 025/127] Added fix for false result type --- lib/rspec-steps/stepwise.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 2cfc81d..a716346 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -1,14 +1,23 @@ module RSpecStepwise + class ApatheticReporter < ::RSpec::Core::Reporter + def notify(*args) + #noop + end + end + class WholeListExample < RSpec::Core::Example def initialize(example_group_class, descriptions, metadata) super + @reporter = ApatheticReporter.new build_example_block end def start(reporter) + super(@reporter) end def finish(reporter) + super(@reporter) end def build_example_block From 7fbc410ad5d9e0caf50aa6684d4c278522527246 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 6 Nov 2013 13:09:21 -0800 Subject: [PATCH 026/127] Bumping version New in this version: steps don't clobber the exit status of RSpec, so they can safely be used in CI --- Gemfile.lock | 2 +- rspec-steps.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1e0d3a6..13fae50 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.1.0) + rspec-steps (0.1.1) rspec (>= 2.6, < 2.14.0) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 7e2298c..d041fea 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.1.0" + spec.version = "0.1.1" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.summary = "I want steps in RSpec" spec.description = <<-EOD I don't like Cucumber. I don't need plain text stories. My clients either - read code or don't read any test documents, so Cucumber is mostly useless. + read code or don't read any test documents, so Cucumber is mostly useless to me. But often, especially in full integration tests, it would be nice to have steps in a test. EOD From 7edcf637a74bf236c20f3678724f26c0da6eaa48 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 6 Nov 2013 13:41:25 -0800 Subject: [PATCH 027/127] Updating Corundum --- Gemfile.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 13fae50..d07c7b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,18 +8,17 @@ GEM remote: http://lrdesign:quiS6Nef@gems.lrdesign.com/ remote: http://rubygems.org/ specs: - chunky_png (1.2.7) + chunky_png (1.2.9) compass (0.12.2) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) - corundum (0.0.25) + corundum (0.1.3) bundler compass (>= 0.12.1) mailfactory (~> 1.4.0) - mattock (>= 0.3.0) + mattock (~> 0.5.3) nokogiri - rake-rubygems (>= 0.2.0) rdoc rspec (>= 2.0) sass (>= 3.1) @@ -31,19 +30,20 @@ GEM rspec (~> 2.0) rspec-instafail (~> 0.2.0) ruby-progressbar (~> 0.0.10) - json (1.7.6) + json (1.8.1) mailfactory (1.4.0) mime-types (>= 1.13.1) - mattock (0.3.4) + mattock (0.5.3) + rake (~> 10.0) tilt (> 0) - valise (>= 0.6) - mime-types (1.19) - multi_json (1.5.0) - nokogiri (1.5.6) - rake (10.0.3) - rake-rubygems (0.2.0) - rake (>= 0.8.7) - rdoc (3.12) + valise (>= 0.9.1) + mime-types (2.0) + mini_portile (0.5.2) + multi_json (1.8.2) + nokogiri (1.6.0) + mini_portile (~> 0.5.0) + rake (10.1.0) + rdoc (4.0.1) json (~> 1.4) rspec (2.10.0) rspec-core (~> 2.10.0) @@ -55,14 +55,14 @@ GEM rspec-instafail (0.2.4) rspec-mocks (2.10.1) ruby-progressbar (0.0.10) - sass (3.2.5) + sass (3.2.12) simplecov (0.7.1) multi_json (~> 1.0) simplecov-html (~> 0.7.1) simplecov-html (0.7.1) - tilt (1.3.3) - valise (0.8.2) - yard (0.8.3) + tilt (1.4.1) + valise (1.0.0) + yard (0.8.7.3) PLATFORMS ruby From 0ac1d48ad7fafa533cfd00c0c9cd824717812f9d Mon Sep 17 00:00:00 2001 From: "David J. Brenes" Date: Thu, 12 Dec 2013 18:40:48 +0100 Subject: [PATCH 028/127] Checking whole list example in search for exceptions This solves the problem when a before hook raises an exception and the steps fail silently --- lib/rspec-steps.rb | 1 + lib/rspec-steps/duckpunch/example.rb | 5 +++++ lib/rspec-steps/stepwise.rb | 6 ++++++ spec/example_group_spec.rb | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 lib/rspec-steps/duckpunch/example.rb diff --git a/lib/rspec-steps.rb b/lib/rspec-steps.rb index 54dafdd..e2af37e 100644 --- a/lib/rspec-steps.rb +++ b/lib/rspec-steps.rb @@ -1,2 +1,3 @@ require 'rspec-steps/duckpunch/object-extensions' require 'rspec-steps/duckpunch/example-group' +require 'rspec-steps/duckpunch/example' diff --git a/lib/rspec-steps/duckpunch/example.rb b/lib/rspec-steps/duckpunch/example.rb new file mode 100644 index 0000000..a645d22 --- /dev/null +++ b/lib/rspec-steps/duckpunch/example.rb @@ -0,0 +1,5 @@ +RSpec::Core::Example.class_eval do + def exception + @exception + end +end diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index a716346..479812c 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -112,6 +112,12 @@ def run_examples(reporter) suspend_transactional_fixtures do whole_list_example.run(instance, reporter) end + + unless whole_list_example.exception.nil? + RSpec.wants_to_quit = true if fail_fast? + fail_filtered_examples(whole_list_example.exception, reporter) + end + end end diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index 0d58922..d1a3123 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -29,6 +29,25 @@ end end + it "should mark later examples as failed if a before hook fails" do + group = nil + exception = Exception.new "Testing Error" + + sandboxed do + group = steps "Test Steps" do + before { raise exception } + it { 1.should == 1 } + it { 1.should == 1 } + end + group.run + end + + group.examples.each do |example| + example.metadata[:execution_result][:status].should == 'failed' + example.metadata[:execution_result][:exception].should == exception + end + end + it "should mark later examples as pending if one fails" do group = nil sandboxed do From 9ddaf73c49ce7946637c12d405e02022b3179121 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 30 Dec 2013 15:33:19 -0800 Subject: [PATCH 029/127] Bumping version --- .travis.yml | 2 ++ Gemfile | 5 +++-- Gemfile.lock | 32 +++++++++++++++++--------------- Rakefile | 8 +++++++- rspec-steps.gemspec | 2 +- 5 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..83f6880 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +language: ruby +script: bundle exec rake ci diff --git a/Gemfile b/Gemfile index c0552b6..7822435 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ -source "http://lrdesign:quiS6Nef@gems.lrdesign.com" -source :rubygems +source "https://rubygems.org" gem 'rspec', "~> 2.10.0" gem 'fuubar' +gem 'tilt', "< 2.0" + gemspec diff --git a/Gemfile.lock b/Gemfile.lock index d07c7b0..7d83d3a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,23 +1,22 @@ PATH remote: . specs: - rspec-steps (0.1.1) + rspec-steps (0.1.2) rspec (>= 2.6, < 2.14.0) GEM - remote: http://lrdesign:quiS6Nef@gems.lrdesign.com/ - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: chunky_png (1.2.9) compass (0.12.2) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) - corundum (0.1.3) + corundum (0.3.2) bundler compass (>= 0.12.1) mailfactory (~> 1.4.0) - mattock (~> 0.5.3) + mattock (~> 0.7) nokogiri rdoc rspec (>= 2.0) @@ -25,6 +24,7 @@ GEM simplecov (>= 0.5.4) yard diff-lcs (1.1.3) + docile (1.1.1) fssm (0.2.10) fuubar (1.0.0) rspec (~> 2.0) @@ -33,17 +33,17 @@ GEM json (1.8.1) mailfactory (1.4.0) mime-types (>= 1.13.1) - mattock (0.5.3) + mattock (0.7.0) rake (~> 10.0) tilt (> 0) valise (>= 0.9.1) mime-types (2.0) mini_portile (0.5.2) multi_json (1.8.2) - nokogiri (1.6.0) + nokogiri (1.6.1) mini_portile (~> 0.5.0) - rake (10.1.0) - rdoc (4.0.1) + rake (10.1.1) + rdoc (4.1.0) json (~> 1.4) rspec (2.10.0) rspec-core (~> 2.10.0) @@ -55,13 +55,14 @@ GEM rspec-instafail (0.2.4) rspec-mocks (2.10.1) ruby-progressbar (0.0.10) - sass (3.2.12) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) + sass (3.2.13) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) tilt (1.4.1) - valise (1.0.0) + valise (1.1.0) yard (0.8.7.3) PLATFORMS @@ -72,3 +73,4 @@ DEPENDENCIES fuubar rspec (~> 2.10.0) rspec-steps! + tilt (< 2.0) diff --git a/Rakefile b/Rakefile index ee781a5..bbfa1a3 100644 --- a/Rakefile +++ b/Rakefile @@ -9,7 +9,13 @@ module Corundum end tk.in_namespace do - sanity = GemspecSanity.new(tk) + GemspecFiles.new(tk) + %w{debug profanity racism ableism sexism issues}.each do |type| + QuestionableContent.new(tk) do |qc| + qc.type = type + end + end + rspec = RSpec.new(tk) cov = SimpleCov.new(tk, rspec) do |cov| cov.threshold = 55 diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index d041fea..2d26824 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.1.1" + spec.version = "0.1.2" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From d46d78769faff9499fd780039b73a699d92efa2b Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 30 Dec 2013 22:35:28 -0800 Subject: [PATCH 030/127] Adding missing file --- rspec-steps.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 2d26824..dd21f2e 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |spec| lib/rspec-steps.rb lib/rspec-steps/stepwise.rb lib/rspec-steps/duckpunch/example-group.rb + lib/rspec-steps/duckpunch/example.rb lib/rspec-steps/duckpunch/object-extensions.rb doc/README doc/Specifications From 43f532809ab859ad3475c7edfb214c1cd534b1b4 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 30 Dec 2013 22:37:58 -0800 Subject: [PATCH 031/127] Removing a TODO --- lib/rspec-steps/stepwise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 479812c..d2436b9 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -55,7 +55,7 @@ def with_around_hooks end module ClassMethods - #TODO: This is hacky and needs a more general solution + #This is hacky and needs a more general solution #Something like cloning the current conf and having RSpec::Stepwise::config ? def suspend_transactional_fixtures if self.respond_to? :use_transactional_fixtures From ae1a88ad76eb25d2224ed00fedc18a1afec6edf4 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 30 Dec 2013 22:41:45 -0800 Subject: [PATCH 032/127] Coverage threshold increased: a whole 80% --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index bbfa1a3..dff8cf9 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,7 @@ module Corundum rspec = RSpec.new(tk) cov = SimpleCov.new(tk, rspec) do |cov| - cov.threshold = 55 + cov.threshold = 80 end gem = GemBuilding.new(tk) cutter = GemCutter.new(tk,gem) From 0a14009f8d7dcb7941751e24763b5532fa03b68d Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 11:50:54 -0800 Subject: [PATCH 033/127] Un-escaping a # in response to #3 [ Close #3 ] --- lib/rspec-steps/stepwise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index d2436b9..eaf7c2b 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -95,7 +95,7 @@ def around(*args, &block) def perform_steps(name, *args, &customization_block) shared_block = world.shared_example_groups[name] - raise "Could not find shared example group named \#{name.inspect}" unless shared_block + raise "Could not find shared example group named #{name.inspect}" unless shared_block module_eval_with_args(*args, &shared_block) module_eval(&customization_block) if customization_block From 5edce750074e603bf7ab47f299043ad49dba5929 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 13:47:11 -0800 Subject: [PATCH 034/127] Adding before and after :step --- lib/rspec-steps/stepwise.rb | 22 +++++++++++++++++ spec/example_group_spec.rb | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index eaf7c2b..4cd3fc7 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -44,9 +44,11 @@ def build_example_block module StepExample def run_before_each + @example_group_class.run_before_step(self) end def run_after_each + @example_group_class.run_after_step(self) end def with_around_hooks @@ -73,6 +75,12 @@ def suspend_transactional_fixtures end def before(*args, &block) + if args.first == :step + args.shift + options = build_metadata_hash_from(args) + return ((hooks[:before][:step] ||= []) << + block.extend(RSpec::Core::Hooks::BeforeHookExtension).with(options)) + end if args.first == :each puts "before blocks declared for steps are always treated as :all scope" end @@ -80,6 +88,12 @@ def before(*args, &block) end def after(*args, &block) + if args.first == :step + args.shift + options = build_metadata_hash_from(args) + hooks[:after][:step] ||= [] + return (hooks[:after][:step].unshift block.extend(RSpec::Core::Hooks::AfterHookExtension).with(options)) + end if args.first == :each puts "after blocks declared for steps are always treated as :all scope" end @@ -93,6 +107,14 @@ def around(*args, &block) super end + def run_before_step(example) + RSpec::Core::Hooks::HookCollection.new(ancestors.reverse.map {|a| a.hooks[:before][:step]}.flatten.compact).for(example).run + end + + def run_after_step(example) + RSpec::Core::Hooks::HookCollection.new(ancestors.map {|a| a.hooks[:after][:step]}.flatten.compact).for(example).run + end + def perform_steps(name, *args, &customization_block) shared_block = world.shared_example_groups[name] raise "Could not find shared example group named #{name.inspect}" unless shared_block diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index d1a3123..f75fa0a 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -29,6 +29,55 @@ end end + it "should run each_step hooks" do + group = nil + afters = [] + befores = [] + + sandboxed do + group = steps "Test Each Step" do + before :each do + befores << :each + end + after :each do + afters << :each + end + + before :all do + befores << :all + end + after :all do + afters << :all + end + + before :step do + befores << :step + end + after :step do + afters << :step + end + + it "should 1" do + 1.should == 1 + end + it "should 2" do + 2.should == 2 + end + it "should 3" do + 3.should == 3 + end + end + group.run + end + + befores.find_all{|item| item == :all}.length.should == 1 + befores.find_all{|item| item == :each}.length.should == 1 + befores.find_all{|item| item == :step}.length.should == 3 + afters.find_all{|item| item == :all}.length.should == 1 + afters.find_all{|item| item == :each}.length.should == 1 + afters.find_all{|item| item == :step}.length.should == 3 + end + it "should mark later examples as failed if a before hook fails" do group = nil exception = Exception.new "Testing Error" From b9143f9cf8059ee9111b2820bee1dc43b6af8cdc Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 13:57:43 -0800 Subject: [PATCH 035/127] Added completely untested "it" synonyms per #1 --- lib/rspec-steps/stepwise.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 4cd3fc7..289e4f3 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -107,6 +107,18 @@ def around(*args, &block) super end + def example_synonym(named, desc=nil, *args, &block) + unless desc.nil? + desc = [named, desc].join(" ") + end + it(desc, *args, &block) + end + + def when(*args, &block); example_synonym("when", *args, &block); end + def then(*args, &block); example_synonym("then", *args, &block); end + def next(*args, &block); example_synonym("next", *args, &block); end + def step(*args, &block); example_synonym("step", *args, &block); end + def run_before_step(example) RSpec::Core::Hooks::HookCollection.new(ancestors.reverse.map {|a| a.hooks[:before][:step]}.flatten.compact).for(example).run end From a53772ae866e7e8400928238d7f441dc1e0d10e5 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 13:59:31 -0800 Subject: [PATCH 036/127] Version bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7d83d3a..b5df0dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.1.2) + rspec-steps (0.2.0) rspec (>= 2.6, < 2.14.0) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index dd21f2e..14903c1 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.1.2" + spec.version = "0.2.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From ba3b7fa4c324247e035acbb31734d0c99952ae75 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:11:50 -0800 Subject: [PATCH 037/127] Working against 2.14 --- Gemfile | 2 +- Gemfile.lock | 43 +++++++++-------- lib/rspec-steps/duckpunch/example-group.rb | 8 ++-- .../duckpunch/object-extensions.rb | 1 - lib/rspec-steps/stepwise.rb | 43 +++++++++++++++-- rspec-steps.gemspec | 2 +- spec/example_group_spec.rb | 2 + spec_help/rspec-sandbox.rb | 46 +------------------ 8 files changed, 70 insertions(+), 77 deletions(-) diff --git a/Gemfile b/Gemfile index 7822435..7d4f510 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem 'rspec', "~> 2.10.0" +gem 'rspec', "~> 2.14.0" gem 'fuubar' gem 'tilt', "< 2.0" diff --git a/Gemfile.lock b/Gemfile.lock index b5df0dc..4c5ecee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rspec-steps (0.2.0) - rspec (>= 2.6, < 2.14.0) + rspec (>= 2.6, < 2.99) GEM remote: https://rubygems.org/ @@ -12,19 +12,18 @@ GEM chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) - corundum (0.3.2) + corundum (0.3.5) bundler compass (>= 0.12.1) mailfactory (~> 1.4.0) - mattock (~> 0.7) + mattock (~> 0.7.1) nokogiri rdoc rspec (>= 2.0) - sass (>= 3.1) simplecov (>= 0.5.4) yard - diff-lcs (1.1.3) - docile (1.1.1) + diff-lcs (1.2.5) + docile (1.1.2) fssm (0.2.10) fuubar (1.0.0) rspec (~> 2.0) @@ -33,36 +32,36 @@ GEM json (1.8.1) mailfactory (1.4.0) mime-types (>= 1.13.1) - mattock (0.7.0) + mattock (0.7.1) rake (~> 10.0) tilt (> 0) - valise (>= 0.9.1) - mime-types (2.0) + valise (~> 1.1.1) + mime-types (2.1) mini_portile (0.5.2) - multi_json (1.8.2) + multi_json (1.8.4) nokogiri (1.6.1) mini_portile (~> 0.5.0) rake (10.1.1) - rdoc (4.1.0) + rdoc (4.1.1) json (~> 1.4) - rspec (2.10.0) - rspec-core (~> 2.10.0) - rspec-expectations (~> 2.10.0) - rspec-mocks (~> 2.10.0) - rspec-core (2.10.1) - rspec-expectations (2.10.0) - diff-lcs (~> 1.1.3) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.7) + rspec-expectations (2.14.4) + diff-lcs (>= 1.1.3, < 2.0) rspec-instafail (0.2.4) - rspec-mocks (2.10.1) + rspec-mocks (2.14.4) ruby-progressbar (0.0.10) - sass (3.2.13) + sass (3.2.14) simplecov (0.8.2) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) tilt (1.4.1) - valise (1.1.0) + valise (1.1.1) yard (0.8.7.3) PLATFORMS @@ -71,6 +70,6 @@ PLATFORMS DEPENDENCIES corundum (>= 0.0.25) fuubar - rspec (~> 2.10.0) + rspec (~> 2.14.0) rspec-steps! tilt (< 2.0) diff --git a/lib/rspec-steps/duckpunch/example-group.rb b/lib/rspec-steps/duckpunch/example-group.rb index 591cb18..2822297 100644 --- a/lib/rspec-steps/duckpunch/example-group.rb +++ b/lib/rspec-steps/duckpunch/example-group.rb @@ -2,7 +2,7 @@ require 'rspec-steps/stepwise' module RSpec::Steps - module ClassMethods + module DSL def steps(*args, &block) options = if args.last.is_a?(Hash) @@ -19,7 +19,9 @@ def steps(*args, &block) end end -RSpec::Core::ExampleGroup.extend RSpec::Steps::ClassMethods -include RSpec::Steps::ClassMethods +RSpec::Core::ExampleGroup.extend RSpec::Steps::DSL + +extend RSpec::Steps::DSL +Module::send(:include, RSpec::Steps::DSL) RSpec::configuration.include(RSpecStepwise, :stepwise => true) diff --git a/lib/rspec-steps/duckpunch/object-extensions.rb b/lib/rspec-steps/duckpunch/object-extensions.rb index 3261c19..1174aef 100644 --- a/lib/rspec-steps/duckpunch/object-extensions.rb +++ b/lib/rspec-steps/duckpunch/object-extensions.rb @@ -6,4 +6,3 @@ module RSpec::Core::SharedExampleGroup alias :shared_steps :share_examples_for alias :steps_shared_as :share_as end -extend RSpec::Steps::ClassMethods diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 289e4f3..ad31ea8 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -45,6 +45,8 @@ def build_example_block module StepExample def run_before_each @example_group_class.run_before_step(self) + rescue Object => ex + puts "\n#{__FILE__}:#{__LINE__} => #{[ex, ex.backtrace].pretty_inspect}" end def run_after_each @@ -74,12 +76,27 @@ def suspend_transactional_fixtures end end + def build_before_hook(options, &block) + if defined? RSpec::Core::Hooks::BeforeHookExtension + block.extend(RSpec::Core::Hooks::BeforeHookExtension).with(options) + else + RSpec::Core::Hooks::BeforeHook.new(block, options) + end + end + + def build_after_hook(options, &block) + if defined? RSpec::Core::Hooks::AfterHookExtension + block.extend(RSpec::Core::Hooks::AfterHookExtension).with(options) + else + RSpec::Core::Hooks::AfterHook.new(block, options) + end + end + def before(*args, &block) if args.first == :step args.shift options = build_metadata_hash_from(args) - return ((hooks[:before][:step] ||= []) << - block.extend(RSpec::Core::Hooks::BeforeHookExtension).with(options)) + return ((hooks[:before][:step] ||= []) << build_before_hook(options, &block)) end if args.first == :each puts "before blocks declared for steps are always treated as :all scope" @@ -92,7 +109,7 @@ def after(*args, &block) args.shift options = build_metadata_hash_from(args) hooks[:after][:step] ||= [] - return (hooks[:after][:step].unshift block.extend(RSpec::Core::Hooks::AfterHookExtension).with(options)) + return (hooks[:after][:step].unshift build_after_hook(options, &block)) end if args.first == :each puts "after blocks declared for steps are always treated as :all scope" @@ -119,12 +136,28 @@ def then(*args, &block); example_synonym("then", *args, &block); end def next(*args, &block); example_synonym("next", *args, &block); end def step(*args, &block); example_synonym("step", *args, &block); end + def run_step(example, hook, &sorting) + groups = if respond_to?(:parent_groups) + parent_groups + else + ancestors + end + + if block_given? + groups = yield groups + end + + RSpec::Core::Hooks::HookCollection.new(groups.map {|a| a.hooks[hook][:step]}.flatten.compact).for(example).run + end + def run_before_step(example) - RSpec::Core::Hooks::HookCollection.new(ancestors.reverse.map {|a| a.hooks[:before][:step]}.flatten.compact).for(example).run + run_step(example, :before) end def run_after_step(example) - RSpec::Core::Hooks::HookCollection.new(ancestors.map {|a| a.hooks[:after][:step]}.flatten.compact).for(example).run + run_step(example, :after) do |groups| + groups.reverse + end end def perform_steps(name, *args, &customization_block) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 14903c1..23eebd6 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -70,7 +70,7 @@ Gem::Specification.new do |spec| spec.rdoc_options += %w{--main doc/README } spec.rdoc_options += ["--title", "#{spec.name}-#{spec.version} RDoc"] - spec.add_dependency("rspec", ">= 2.6", "< 2.14.0") + spec.add_dependency("rspec", ">= 2.6", "< 2.99") spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" end diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index f75fa0a..934aaa0 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -24,7 +24,9 @@ group.run end + require 'pp' group.examples.each do |example| + puts "\n#{__FILE__}:#{__LINE__} => #{example.metadata.pretty_inspect}" example.metadata[:execution_result][:status].should == 'passed' end end diff --git a/spec_help/rspec-sandbox.rb b/spec_help/rspec-sandbox.rb index 7254580..954a0ef 100644 --- a/spec_help/rspec-sandbox.rb +++ b/spec_help/rspec-sandbox.rb @@ -19,6 +19,8 @@ def sandboxed(&block) object = Object.new object.extend(RSpec::Core::SharedExampleGroup) + object.extend(RSpec::Steps::DSL) + object.extend(RSpec::Core::DSL) (class << RSpec::Core::ExampleGroup; self; end).class_eval do alias_method :orig_run, :run @@ -42,47 +44,3 @@ def run(reporter=nil) RSpec.instance_variable_set(:@configuration, @orig_config) RSpec.instance_variable_set(:@world, @orig_world) end - -#Original from rspec-core -=begin -class << RSpec - alias_method :original_warn_about_deprecated_configure, :warn_about_deprecated_configure - - def warn_about_deprecated_configure - # no-op: in our specs we don't want to see the warning. - end - - alias_method :null_warn_about_deprecated_configure, :warn_about_deprecated_configure - - def allowing_configure_warning - (class << self; self; end).class_eval do - alias_method :warn_about_deprecated_configure, :original_warn_about_deprecated_configure - begin - yield - ensure - alias_method :warn_about_deprecated_configure, :null_warn_about_deprecated_configure - end - end - end -end - -RSpec.configure do |c| - c.color_enabled = !in_editor? - c.filter_run :focus => true - c.run_all_when_everything_filtered = true - c.filter_run_excluding :ruby => lambda {|version| - case version.to_s - when "!jruby" - RUBY_ENGINE == "jruby" - when /^> (.*)/ - !(RUBY_VERSION.to_s > $1) - else - !(RUBY_VERSION.to_s =~ /^#{version.to_s}/) - end - } - c.around do |example| - sandboxed { example.run } - end -end -=begin -=end From 4201390c2ceed59d3d176d4fda1c59c6f3bd622d Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:13:31 -0800 Subject: [PATCH 038/127] Version bump --- Gemfile | 2 -- Gemfile.lock | 4 +--- rspec-steps.gemspec | 2 +- spec/example_group_spec.rb | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 7d4f510..b4c4f6a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source "https://rubygems.org" -gem 'rspec', "~> 2.14.0" gem 'fuubar' -gem 'tilt', "< 2.0" gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 4c5ecee..9fa7396 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.2.0) + rspec-steps (0.3.0) rspec (>= 2.6, < 2.99) GEM @@ -70,6 +70,4 @@ PLATFORMS DEPENDENCIES corundum (>= 0.0.25) fuubar - rspec (~> 2.14.0) rspec-steps! - tilt (< 2.0) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 23eebd6..43fe66c 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.2.0" + spec.version = "0.3.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index 934aaa0..f75fa0a 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -24,9 +24,7 @@ group.run end - require 'pp' group.examples.each do |example| - puts "\n#{__FILE__}:#{__LINE__} => #{example.metadata.pretty_inspect}" example.metadata[:execution_result][:status].should == 'passed' end end From f742913ed2bf52e54408b40ef7aa6c416bc099d9 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:21:01 -0800 Subject: [PATCH 039/127] Adding CI testing matrix vs. rspec versions --- .travis.yml | 4 ++++ gemfiles/2.10 | 5 +++++ gemfiles/2.14 | 5 +++++ gemfiles/2.6 | 5 +++++ 4 files changed, 19 insertions(+) create mode 100644 gemfiles/2.10 create mode 100644 gemfiles/2.14 create mode 100644 gemfiles/2.6 diff --git a/.travis.yml b/.travis.yml index 83f6880..0de561a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,6 @@ language: ruby script: bundle exec rake ci +gemfile: + - gemfiles/2.6 + - gemfiles/2.10 + - gemfiles/2.14 diff --git a/gemfiles/2.10 b/gemfiles/2.10 new file mode 100644 index 0000000..7096968 --- /dev/null +++ b/gemfiles/2.10 @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "rspec", "~> 2.10.0" + +gemspec diff --git a/gemfiles/2.14 b/gemfiles/2.14 new file mode 100644 index 0000000..5e2d99a --- /dev/null +++ b/gemfiles/2.14 @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "rspec", "~> 2.14.0" + +gemspec diff --git a/gemfiles/2.6 b/gemfiles/2.6 new file mode 100644 index 0000000..9bd06cb --- /dev/null +++ b/gemfiles/2.6 @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "rspec", "~> 2.6.0" + +gemspec From e484fa0e4979bedc8342f62928dc10a14e44cf4b Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:32:00 -0800 Subject: [PATCH 040/127] Trying to get build matrix going... --- gemfiles/2.10 | 2 +- gemfiles/2.14 | 2 +- gemfiles/2.6 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gemfiles/2.10 b/gemfiles/2.10 index 7096968..cef6f41 100644 --- a/gemfiles/2.10 +++ b/gemfiles/2.10 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.10.0" -gemspec +gemspec, :path => "../rspec-steps.gemspec" diff --git a/gemfiles/2.14 b/gemfiles/2.14 index 5e2d99a..9bcf425 100644 --- a/gemfiles/2.14 +++ b/gemfiles/2.14 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.14.0" -gemspec +gemspec, :path => "../rspec-steps.gemspec" diff --git a/gemfiles/2.6 b/gemfiles/2.6 index 9bd06cb..6f9031f 100644 --- a/gemfiles/2.6 +++ b/gemfiles/2.6 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.6.0" -gemspec +gemspec, :path => "../rspec-steps.gemspec" From ebe14df073e6c9a7661af6a9abbddde3acc9954a Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:35:39 -0800 Subject: [PATCH 041/127] Stupid commas --- gemfiles/2.10 | 2 +- gemfiles/2.14 | 2 +- gemfiles/2.6 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gemfiles/2.10 b/gemfiles/2.10 index cef6f41..269f0c6 100644 --- a/gemfiles/2.10 +++ b/gemfiles/2.10 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.10.0" -gemspec, :path => "../rspec-steps.gemspec" +gemspec :path => "../rspec-steps.gemspec" diff --git a/gemfiles/2.14 b/gemfiles/2.14 index 9bcf425..31b3a57 100644 --- a/gemfiles/2.14 +++ b/gemfiles/2.14 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.14.0" -gemspec, :path => "../rspec-steps.gemspec" +gemspec :path => "../rspec-steps.gemspec" diff --git a/gemfiles/2.6 b/gemfiles/2.6 index 6f9031f..9a822fd 100644 --- a/gemfiles/2.6 +++ b/gemfiles/2.6 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.6.0" -gemspec, :path => "../rspec-steps.gemspec" +gemspec :path => "../rspec-steps.gemspec" From be85f7965a7ee2bd00c33bf88094c9bdd4ddd01d Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:37:58 -0800 Subject: [PATCH 042/127] Right the first time --- gemfiles/2.10 | 2 +- gemfiles/2.14 | 2 +- gemfiles/2.6 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gemfiles/2.10 b/gemfiles/2.10 index 269f0c6..4a62d31 100644 --- a/gemfiles/2.10 +++ b/gemfiles/2.10 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.10.0" -gemspec :path => "../rspec-steps.gemspec" +gemspec :path => ".." diff --git a/gemfiles/2.14 b/gemfiles/2.14 index 31b3a57..952c48a 100644 --- a/gemfiles/2.14 +++ b/gemfiles/2.14 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.14.0" -gemspec :path => "../rspec-steps.gemspec" +gemspec :path => ".." diff --git a/gemfiles/2.6 b/gemfiles/2.6 index 9a822fd..e91c931 100644 --- a/gemfiles/2.6 +++ b/gemfiles/2.6 @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "rspec", "~> 2.6.0" -gemspec :path => "../rspec-steps.gemspec" +gemspec :path => ".." From 41708cb1955275460dec317afde1e569e28d8038 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:40:04 -0800 Subject: [PATCH 043/127] Adding Ruby version to the matrix --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0de561a..5b70b52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,7 @@ gemfile: - gemfiles/2.6 - gemfiles/2.10 - gemfiles/2.14 +ruby: + - "1.9.3" + - "2.0.0" + - "2.1.0" From c591dbac63eeadbc179016cee8ddb34645f0223d Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 28 Jan 2014 16:48:20 -0800 Subject: [PATCH 044/127] s/ruby/rvm --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5b70b52..ed4a249 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ gemfile: - gemfiles/2.6 - gemfiles/2.10 - gemfiles/2.14 -ruby: +rvm: - "1.9.3" - "2.0.0" - "2.1.0" From 52a5c99f95642b0a49d74f3fb13a92ebac5c2bf7 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 24 Feb 2014 11:18:21 -0800 Subject: [PATCH 045/127] Fixing shared_steps --- .ruby-version | 1 + lib/rspec-steps/stepwise.rb | 7 ++++++- spec/example_group_spec.rb | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..cd5ac03 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.0 diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index ad31ea8..872e405 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -161,7 +161,12 @@ def run_after_step(example) end def perform_steps(name, *args, &customization_block) - shared_block = world.shared_example_groups[name] + shared_block = nil + if world.respond_to? :shared_example_groups + shared_block = world.shared_example_groups[name] + else + shared_block = shared_example_groups[name] + end raise "Could not find shared example group named #{name.inspect}" unless shared_block module_eval_with_args(*args, &shared_block) diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index f75fa0a..482cf06 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -29,6 +29,27 @@ end end + it "should work with shared_steps/perform steps" do + group = nil + sandboxed do + group = steps "Test Steps" do + shared_steps "add one" do + it("adds one to @a"){ @a += 1 } + end + it("sets @a"){ @a = 1 } + perform_steps "add one" + perform_steps "add one" + perform_steps "add one" + it("reads @a"){ @a.should == 4 } + end + group.run + end + + group.examples.each do |example| + example.metadata[:execution_result][:status].should == 'passed' + end + end + it "should run each_step hooks" do group = nil afters = [] From 34fd4973afc7a5f075e30d81c9bfe7cdf39ced3f Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 24 Feb 2014 11:18:59 -0800 Subject: [PATCH 046/127] Version bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9fa7396..d8516ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.3.0) + rspec-steps (0.4.0) rspec (>= 2.6, < 2.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 43fe66c..c99d210 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.3.0" + spec.version = "0.4.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 0ae64f6c5e47fd5e9fda87784fbbad267b8b8ccd Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 6 Jun 2014 20:06:34 -0700 Subject: [PATCH 047/127] Adding Travis for RSpec 3.0 hahahahahahahahahaha --- gemfiles/3.0 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 gemfiles/3.0 diff --git a/gemfiles/3.0 b/gemfiles/3.0 new file mode 100644 index 0000000..5e3fdb2 --- /dev/null +++ b/gemfiles/3.0 @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "rspec", "~> 3.0.0" + +gemspec :path => ".." From 9994fd919418faa8e795cef35ac7b3a88a5480d2 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 6 Jun 2014 20:09:28 -0700 Subject: [PATCH 048/127] Added 3.0 to build matrix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ed4a249..5444e9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ gemfile: - gemfiles/2.6 - gemfiles/2.10 - gemfiles/2.14 + - gemfiles/3.0 rvm: - "1.9.3" - "2.0.0" From fb9ba6dd35ca07c5ad3dc5415599aa2f72d80fa2 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 7 Jun 2014 02:11:16 -0700 Subject: [PATCH 049/127] Irritating status result error --- lib/rspec-steps/stepwise.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 872e405..875fedd 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -181,7 +181,7 @@ def run_examples(reporter) instance.example = whole_list_example instance.reporter = reporter - suspend_transactional_fixtures do + result = suspend_transactional_fixtures do whole_list_example.run(instance, reporter) end @@ -190,6 +190,7 @@ def run_examples(reporter) fail_filtered_examples(whole_list_example.exception, reporter) end + result end end From 097af03bbfc8587303386fb4087116fe42c669c7 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 7 Jun 2014 02:11:59 -0700 Subject: [PATCH 050/127] Version bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d8516ed..b9afc86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.4.0) + rspec-steps (0.4.1) rspec (>= 2.6, < 2.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index c99d210..292f650 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.4.0" + spec.version = "0.4.1" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From ee898cb35bb5715f40fd880dbc304c77e943a576 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 7 Jun 2014 02:13:43 -0700 Subject: [PATCH 051/127] Experimental relaxation of version lock --- rspec-steps.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 292f650..83b4fed 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -70,7 +70,7 @@ Gem::Specification.new do |spec| spec.rdoc_options += %w{--main doc/README } spec.rdoc_options += ["--title", "#{spec.name}-#{spec.version} RDoc"] - spec.add_dependency("rspec", ">= 2.6", "< 2.99") + spec.add_dependency("rspec", ">= 2.6", "< 3.99") spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" end From 1d2801e0514d5d96306e11170433b7b63d642804 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:13:10 -0700 Subject: [PATCH 052/127] Attempting cached bundles --- .travis-support/cached-bundle | 46 +++++++++++++++++++++++ .travis-support/s3-put | 71 +++++++++++++++++++++++++++++++++++ .travis.yml | 19 ++++++---- 3 files changed, 129 insertions(+), 7 deletions(-) create mode 100755 .travis-support/cached-bundle create mode 100755 .travis-support/s3-put diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle new file mode 100755 index 0000000..a9fb116 --- /dev/null +++ b/.travis-support/cached-bundle @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# Usage: cached-bundle install --deployment +# +# After running `bundle`, caches the `vendor/bundle` directory to S3. +# On the next run, restores the cached directory before running `bundle`. +# When `Gemfile.lock` changes, the cache gets rebuilt. +# +# Requirements: +# - Gemfile.lock +# - TRAVIS_REPO_SLUG +# - TRAVIS_RUBY_VERSION +# - AMAZON_S3_BUCKET +# - script/s3-put +# - bundle +# - curl +# +# Author: Mislav Marohnić + +set -e + +compute_md5() { + local output="$(openssl md5)" + echo "${output##* }" +} + +download() { + curl --tcp-nodelay -qsfL "$1" -o "$2" +} + +bundle_path="vendor/bundle" +gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" +cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" +fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}" + +if download "$fetch_url" "$cache_name"; then + echo "Reusing cached bundle ${cache_name}" + tar xzf "$cache_name" +fi + +bundle "$@" + +if [ ! -f "$cache_name" ]; then + echo "Caching \`${bundle_path}' to S3" + tar czf "$cache_name" "$bundle_path" + .travis-support/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" +fi diff --git a/.travis-support/s3-put b/.travis-support/s3-put new file mode 100755 index 0000000..036e845 --- /dev/null +++ b/.travis-support/s3-put @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# Usage: s3-put [:] [] +# +# Uploads a file to the Amazon S3 service. +# Outputs the URL for the newly uploaded file. +# +# Requirements: +# - AMAZON_ACCESS_KEY_ID +# - AMAZON_SECRET_ACCESS_KEY +# - openssl +# - curl +# +# Author: Mislav Marohnić + +set -e + +authorization() { + local signature="$(string_to_sign | hmac_sha1 | base64)" + echo "AWS ${AMAZON_ACCESS_KEY_ID?}:${signature}" +} + +hmac_sha1() { + openssl dgst -binary -sha1 -hmac "${AMAZON_SECRET_ACCESS_KEY?}" +} + +base64() { + openssl enc -base64 +} + +bin_md5() { + openssl dgst -binary -md5 +} + +string_to_sign() { + echo "$http_method" + echo "$content_md5" + echo "$content_type" + echo "$date" + echo "x-amz-acl:$acl" + printf "/$bucket/$remote_path" +} + +date_string() { + LC_TIME=C date "+%a, %d %h %Y %T %z" +} + +file="$1" +bucket="${2%%:*}" +remote_path="${2#*:}" +content_type="$3" + +if [ -z "$remote_path" ] || [ "$remote_path" = "$bucket" ]; then + remote_path="${file##*/}" +fi + +http_method=PUT +acl="public-read" +content_md5="$(bin_md5 < "$file" | base64)" +date="$(date_string)" + +url="https://$bucket.s3.amazonaws.com/$remote_path" + +curl -qsSf -T "$file" \ + -H "Authorization: $(authorization)" \ + -H "x-amz-acl: $acl" \ + -H "Date: $date" \ + -H "Content-MD5: $content_md5" \ + -H "Content-Type: $content_type" \ + "$url" + +echo "$url" diff --git a/.travis.yml b/.travis.yml index 5444e9f..ff90578 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,16 @@ language: ruby script: bundle exec rake ci +install: .travis-support/cached-bundle install gemfile: - - gemfiles/2.6 - - gemfiles/2.10 - - gemfiles/2.14 - - gemfiles/3.0 +- gemfiles/2.6 +- gemfiles/2.10 +- gemfiles/2.14 +- gemfiles/3.0 rvm: - - "1.9.3" - - "2.0.0" - - "2.1.0" +- 1.9.3 +- 2.0.0 +- 2.1.0 +env: + global: + - AMAZON_S3_BUCKET: lrd-travis-caching + - secure: FNjEW8P99C8cwdhw80iNa1nauVrKVpvOzp5Sr0yiwpfx6lDC5/E53fSQoBkd4a4nb8L7CdyJ5O/ynarb/xA11GNFQ/URqjyV1cHTaZGWqgX75nMheVL4RKrWu72y3rl8G/EQvEelmDc/0LHhE9zOq/OuZZkB4z+pjFMEwNZDbS4= From 862023555aff7daa6bb62cdd002438925485827c Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:17:52 -0700 Subject: [PATCH 053/127] Gemfile locks --- gemfiles/2.10.lock | 69 +++++++++++++++++++++++++++++++++++++++++++ gemfiles/2.14.lock | 69 +++++++++++++++++++++++++++++++++++++++++++ gemfiles/2.6.lock | 69 +++++++++++++++++++++++++++++++++++++++++++ gemfiles/3.0.lock | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 gemfiles/2.10.lock create mode 100644 gemfiles/2.14.lock create mode 100644 gemfiles/2.6.lock create mode 100644 gemfiles/3.0.lock diff --git a/gemfiles/2.10.lock b/gemfiles/2.10.lock new file mode 100644 index 0000000..d3f1f99 --- /dev/null +++ b/gemfiles/2.10.lock @@ -0,0 +1,69 @@ +PATH + remote: .. + specs: + rspec-steps (0.4.1) + rspec (>= 2.6, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + chunky_png (1.3.1) + compass (0.12.6) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (~> 3.2.19) + corundum (0.3.7) + bundler + compass (>= 0.12.1) + mailfactory (~> 1.4.0) + mattock (~> 0.7.1) + nokogiri + paint (~> 0.8.7) + rdoc + rspec (>= 2.0) + simplecov (>= 0.5.4) + yard + diff-lcs (1.1.3) + docile (1.1.5) + fssm (0.2.10) + json (1.8.1) + mailfactory (1.4.0) + mime-types (>= 1.13.1) + mattock (0.7.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + mime-types (2.3) + mini_portile (0.6.0) + multi_json (1.10.1) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) + paint (0.8.7) + rake (10.3.2) + rdoc (4.1.1) + json (~> 1.4) + rspec (2.10.0) + rspec-core (~> 2.10.0) + rspec-expectations (~> 2.10.0) + rspec-mocks (~> 2.10.0) + rspec-core (2.10.1) + rspec-expectations (2.10.0) + diff-lcs (~> 1.1.3) + rspec-mocks (2.10.1) + sass (3.2.19) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + tilt (2.0.1) + valise (1.1.1) + yard (0.8.7.4) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (>= 0.0.25) + rspec (~> 2.10.0) + rspec-steps! diff --git a/gemfiles/2.14.lock b/gemfiles/2.14.lock new file mode 100644 index 0000000..41138e1 --- /dev/null +++ b/gemfiles/2.14.lock @@ -0,0 +1,69 @@ +PATH + remote: .. + specs: + rspec-steps (0.4.1) + rspec (>= 2.6, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + chunky_png (1.3.1) + compass (0.12.6) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (~> 3.2.19) + corundum (0.3.7) + bundler + compass (>= 0.12.1) + mailfactory (~> 1.4.0) + mattock (~> 0.7.1) + nokogiri + paint (~> 0.8.7) + rdoc + rspec (>= 2.0) + simplecov (>= 0.5.4) + yard + diff-lcs (1.2.5) + docile (1.1.5) + fssm (0.2.10) + json (1.8.1) + mailfactory (1.4.0) + mime-types (>= 1.13.1) + mattock (0.7.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + mime-types (2.3) + mini_portile (0.6.0) + multi_json (1.10.1) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) + paint (0.8.7) + rake (10.3.2) + rdoc (4.1.1) + json (~> 1.4) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.8) + rspec-expectations (2.14.5) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.6) + sass (3.2.19) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + tilt (2.0.1) + valise (1.1.1) + yard (0.8.7.4) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (>= 0.0.25) + rspec (~> 2.14.0) + rspec-steps! diff --git a/gemfiles/2.6.lock b/gemfiles/2.6.lock new file mode 100644 index 0000000..330763c --- /dev/null +++ b/gemfiles/2.6.lock @@ -0,0 +1,69 @@ +PATH + remote: .. + specs: + rspec-steps (0.4.1) + rspec (>= 2.6, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + chunky_png (1.3.1) + compass (0.12.6) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (~> 3.2.19) + corundum (0.3.7) + bundler + compass (>= 0.12.1) + mailfactory (~> 1.4.0) + mattock (~> 0.7.1) + nokogiri + paint (~> 0.8.7) + rdoc + rspec (>= 2.0) + simplecov (>= 0.5.4) + yard + diff-lcs (1.1.3) + docile (1.1.5) + fssm (0.2.10) + json (1.8.1) + mailfactory (1.4.0) + mime-types (>= 1.13.1) + mattock (0.7.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + mime-types (2.3) + mini_portile (0.6.0) + multi_json (1.10.1) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) + paint (0.8.7) + rake (10.3.2) + rdoc (4.1.1) + json (~> 1.4) + rspec (2.6.0) + rspec-core (~> 2.6.0) + rspec-expectations (~> 2.6.0) + rspec-mocks (~> 2.6.0) + rspec-core (2.6.4) + rspec-expectations (2.6.0) + diff-lcs (~> 1.1.2) + rspec-mocks (2.6.0) + sass (3.2.19) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + tilt (2.0.1) + valise (1.1.1) + yard (0.8.7.4) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (>= 0.0.25) + rspec (~> 2.6.0) + rspec-steps! diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock new file mode 100644 index 0000000..5717f97 --- /dev/null +++ b/gemfiles/3.0.lock @@ -0,0 +1,73 @@ +PATH + remote: .. + specs: + rspec-steps (0.4.1) + rspec (>= 2.6, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + chunky_png (1.3.1) + compass (0.12.6) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (~> 3.2.19) + corundum (0.3.7) + bundler + compass (>= 0.12.1) + mailfactory (~> 1.4.0) + mattock (~> 0.7.1) + nokogiri + paint (~> 0.8.7) + rdoc + rspec (>= 2.0) + simplecov (>= 0.5.4) + yard + diff-lcs (1.2.5) + docile (1.1.5) + fssm (0.2.10) + json (1.8.1) + mailfactory (1.4.0) + mime-types (>= 1.13.1) + mattock (0.7.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + mime-types (2.3) + mini_portile (0.6.0) + multi_json (1.10.1) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) + paint (0.8.7) + rake (10.3.2) + rdoc (4.1.1) + json (~> 1.4) + rspec (3.0.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-core (3.0.1) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.0.0) + rspec-mocks (3.0.1) + rspec-support (~> 3.0.0) + rspec-support (3.0.0) + sass (3.2.19) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + tilt (2.0.1) + valise (1.1.1) + yard (0.8.7.4) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (>= 0.0.25) + rspec (~> 3.0.0) + rspec-steps! From 56bafde38a0c94b41d7f83a6b3cbd79e18a094e7 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:23:37 -0700 Subject: [PATCH 054/127] Fixing for travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ff90578..a8ce914 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby script: bundle exec rake ci -install: .travis-support/cached-bundle install +install: .travis-support/cached-bundle install --deployment gemfile: - gemfiles/2.6 - gemfiles/2.10 From 09dc99663b4e06e79bb561dd68843ad9e4bc6dac Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:26:56 -0700 Subject: [PATCH 055/127] Fixing(?) travis creds --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a8ce914..e497c20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,5 @@ rvm: env: global: - AMAZON_S3_BUCKET: lrd-travis-caching - - secure: FNjEW8P99C8cwdhw80iNa1nauVrKVpvOzp5Sr0yiwpfx6lDC5/E53fSQoBkd4a4nb8L7CdyJ5O/ynarb/xA11GNFQ/URqjyV1cHTaZGWqgX75nMheVL4RKrWu72y3rl8G/EQvEelmDc/0LHhE9zOq/OuZZkB4z+pjFMEwNZDbS4= + - secure: b+5Ei+klIudmG+mWu2y6EgHZ/1GxOYX65jGskmQm85lahFUn9jVUn4IhDbERTmBGjjovZvAZ1cIzZg7hhOH2WRcWJX5My13KZv3hurz2jWeziIQp2LtURi7Ghah/1py+82oFTTQe/18A+ONGN7tksqAlWen/UOmfZzXpNPnyF9s= + - secure: FxV30BIED4dP/GkBGF8gtoWirzDzT0Gzn0GxocREp0BZAY9ti5YYoDQixPVCvtQCIKPUjUHnNd8KXdn0HtUhlgLhg7lEE03MoupsXoMZk8gNBeffcCRkzrpVBTmLEhdnoV3UNKpfn2+qCUSqqJimTarDe6k/7F5FzOl3R+xJgxw= From 620ba09030a29b40da0b325b25b2f8d3135f8004 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:34:51 -0700 Subject: [PATCH 056/127] Tweaking cached-bundle somewhat --- .travis-support/cached-bundle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index a9fb116..e1a82df 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -27,7 +27,7 @@ download() { curl --tcp-nodelay -qsfL "$1" -o "$2" } -bundle_path="vendor/bundle" +bundle_path="./vendor/bundle" gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}" @@ -41,6 +41,7 @@ bundle "$@" if [ ! -f "$cache_name" ]; then echo "Caching \`${bundle_path}' to S3" + ls -R * tar czf "$cache_name" "$bundle_path" .travis-support/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" fi From 4507472b2bce9749f29a65a17f416e563bc44c37 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:45:44 -0700 Subject: [PATCH 057/127] Working around for weirdness in bundler vendoring --- .travis-support/cached-bundle | 2 +- .travis.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index e1a82df..af1d246 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -27,7 +27,7 @@ download() { curl --tcp-nodelay -qsfL "$1" -o "$2" } -bundle_path="./vendor/bundle" +bundle_path=${BUNDLE_PATH:-"vendor/bundle"} gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}" diff --git a/.travis.yml b/.travis.yml index e497c20..abc12d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ rvm: - 2.1.0 env: global: + - BUNDLE_PATH: gemfiles/vendor/bundle - AMAZON_S3_BUCKET: lrd-travis-caching - secure: b+5Ei+klIudmG+mWu2y6EgHZ/1GxOYX65jGskmQm85lahFUn9jVUn4IhDbERTmBGjjovZvAZ1cIzZg7hhOH2WRcWJX5My13KZv3hurz2jWeziIQp2LtURi7Ghah/1py+82oFTTQe/18A+ONGN7tksqAlWen/UOmfZzXpNPnyF9s= - secure: FxV30BIED4dP/GkBGF8gtoWirzDzT0Gzn0GxocREp0BZAY9ti5YYoDQixPVCvtQCIKPUjUHnNd8KXdn0HtUhlgLhg7lEE03MoupsXoMZk8gNBeffcCRkzrpVBTmLEhdnoV3UNKpfn2+qCUSqqJimTarDe6k/7F5FzOl3R+xJgxw= From 58222160802b96107e58a0c24cd0cd435b29c57b Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 17:53:53 -0700 Subject: [PATCH 058/127] Working around for weirdness in bundler vendoring --- .travis-support/cached-bundle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index af1d246..726f404 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -27,7 +27,7 @@ download() { curl --tcp-nodelay -qsfL "$1" -o "$2" } -bundle_path=${BUNDLE_PATH:-"vendor/bundle"} +bundle_path=${BUNDLE_PATH:-vendor/bundle} gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}" @@ -41,7 +41,7 @@ bundle "$@" if [ ! -f "$cache_name" ]; then echo "Caching \`${bundle_path}' to S3" - ls -R * + echo "BUNDLE_PATH=${BUNDLE_PATH}" tar czf "$cache_name" "$bundle_path" .travis-support/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" fi From 774ca78432749ff1053a2bb4c9d92d387c388e89 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 21:44:11 -0700 Subject: [PATCH 059/127] Travis debug --- .travis-support/cached-bundle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index 726f404..09d4bad 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -16,6 +16,7 @@ # # Author: Mislav Marohnić +env set -e compute_md5() { @@ -27,6 +28,7 @@ download() { curl --tcp-nodelay -qsfL "$1" -o "$2" } +echo $BUNDLE_PATH bundle_path=${BUNDLE_PATH:-vendor/bundle} gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" From be57585ffd5c33234ce9a2a05c78fda5c885addc Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 21:55:43 -0700 Subject: [PATCH 060/127] Travis debug --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index abc12d2..3aba4b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ rvm: - 2.1.0 env: global: - - BUNDLE_PATH: gemfiles/vendor/bundle - - AMAZON_S3_BUCKET: lrd-travis-caching + - BUNDLE_PATH=gemfiles/vendor/bundle AMAZON_S3_BUCKET=lrd-travis-caching - secure: b+5Ei+klIudmG+mWu2y6EgHZ/1GxOYX65jGskmQm85lahFUn9jVUn4IhDbERTmBGjjovZvAZ1cIzZg7hhOH2WRcWJX5My13KZv3hurz2jWeziIQp2LtURi7Ghah/1py+82oFTTQe/18A+ONGN7tksqAlWen/UOmfZzXpNPnyF9s= - secure: FxV30BIED4dP/GkBGF8gtoWirzDzT0Gzn0GxocREp0BZAY9ti5YYoDQixPVCvtQCIKPUjUHnNd8KXdn0HtUhlgLhg7lEE03MoupsXoMZk8gNBeffcCRkzrpVBTmLEhdnoV3UNKpfn2+qCUSqqJimTarDe6k/7F5FzOl3R+xJgxw= From 4ed078d0a0d256d8de08b5ad794be8a5a6a8966a Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 22:00:41 -0700 Subject: [PATCH 061/127] Travis debug --- .travis-support/cached-bundle | 6 +++--- .travis.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index 09d4bad..d04ab70 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -28,8 +28,8 @@ download() { curl --tcp-nodelay -qsfL "$1" -o "$2" } -echo $BUNDLE_PATH -bundle_path=${BUNDLE_PATH:-vendor/bundle} +echo $CUSTOM_BUNDLE_PATH +bundle_path=${CUSTOM_BUNDLE_PATH:-vendor/bundle} gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}" @@ -43,7 +43,7 @@ bundle "$@" if [ ! -f "$cache_name" ]; then echo "Caching \`${bundle_path}' to S3" - echo "BUNDLE_PATH=${BUNDLE_PATH}" + echo "CUSTOM_BUNDLE_PATH=${CUSTOM_BUNDLE_PATH}" tar czf "$cache_name" "$bundle_path" .travis-support/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" fi diff --git a/.travis.yml b/.travis.yml index 3aba4b3..4c2d9a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,6 @@ rvm: - 2.1.0 env: global: - - BUNDLE_PATH=gemfiles/vendor/bundle AMAZON_S3_BUCKET=lrd-travis-caching + - CUSTOM_BUNDLE_PATH=gemfiles/vendor/bundle AMAZON_S3_BUCKET=lrd-travis-caching - secure: b+5Ei+klIudmG+mWu2y6EgHZ/1GxOYX65jGskmQm85lahFUn9jVUn4IhDbERTmBGjjovZvAZ1cIzZg7hhOH2WRcWJX5My13KZv3hurz2jWeziIQp2LtURi7Ghah/1py+82oFTTQe/18A+ONGN7tksqAlWen/UOmfZzXpNPnyF9s= - secure: FxV30BIED4dP/GkBGF8gtoWirzDzT0Gzn0GxocREp0BZAY9ti5YYoDQixPVCvtQCIKPUjUHnNd8KXdn0HtUhlgLhg7lEE03MoupsXoMZk8gNBeffcCRkzrpVBTmLEhdnoV3UNKpfn2+qCUSqqJimTarDe6k/7F5FzOl3R+xJgxw= From b95fe5d18fa00448ad06200058f597e1d090591c Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 22:29:36 -0700 Subject: [PATCH 062/127] Making S3 caching more chatty --- .travis-support/cached-bundle | 2 +- .travis-support/s3-put | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index d04ab70..9596a0a 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -43,7 +43,7 @@ bundle "$@" if [ ! -f "$cache_name" ]; then echo "Caching \`${bundle_path}' to S3" - echo "CUSTOM_BUNDLE_PATH=${CUSTOM_BUNDLE_PATH}" tar czf "$cache_name" "$bundle_path" + echo "Putting $cache_name to ${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" .travis-support/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" fi diff --git a/.travis-support/s3-put b/.travis-support/s3-put index 036e845..81bd583 100755 --- a/.travis-support/s3-put +++ b/.travis-support/s3-put @@ -60,7 +60,9 @@ date="$(date_string)" url="https://$bucket.s3.amazonaws.com/$remote_path" -curl -qsSf -T "$file" \ +echo "Uploading $file to S3 bucket $bucket/$remote_path with ${AMAZON_ACCESS_KEY_ID}" + +curl -qSf -T "$file" \ -H "Authorization: $(authorization)" \ -H "x-amz-acl: $acl" \ -H "Date: $date" \ From f68fc147f9f31b895e12faa30f3a521598f15e3d Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 22:58:56 -0700 Subject: [PATCH 063/127] Removing attempt to set ACL on S3 objects --- .travis-support/cached-bundle | 2 -- .travis-support/s3-put | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index 9596a0a..9e83658 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -16,7 +16,6 @@ # # Author: Mislav Marohnić -env set -e compute_md5() { @@ -28,7 +27,6 @@ download() { curl --tcp-nodelay -qsfL "$1" -o "$2" } -echo $CUSTOM_BUNDLE_PATH bundle_path=${CUSTOM_BUNDLE_PATH:-vendor/bundle} gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.tgz" diff --git a/.travis-support/s3-put b/.travis-support/s3-put index 81bd583..77b1cf5 100755 --- a/.travis-support/s3-put +++ b/.travis-support/s3-put @@ -36,7 +36,6 @@ string_to_sign() { echo "$content_md5" echo "$content_type" echo "$date" - echo "x-amz-acl:$acl" printf "/$bucket/$remote_path" } @@ -47,7 +46,7 @@ date_string() { file="$1" bucket="${2%%:*}" remote_path="${2#*:}" -content_type="$3" +content_type="${3:-binary/octet-stream}" if [ -z "$remote_path" ] || [ "$remote_path" = "$bucket" ]; then remote_path="${file##*/}" @@ -64,7 +63,6 @@ echo "Uploading $file to S3 bucket $bucket/$remote_path with ${AMAZON_ACCESS_KEY curl -qSf -T "$file" \ -H "Authorization: $(authorization)" \ - -H "x-amz-acl: $acl" \ -H "Date: $date" \ -H "Content-MD5: $content_md5" \ -H "Content-Type: $content_type" \ From 6889aab3dc590a2ac97de5462978818f67491637 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 23:04:09 -0700 Subject: [PATCH 064/127] Reattempting --- .travis-support/cached-bundle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis-support/cached-bundle b/.travis-support/cached-bundle index 9e83658..01999b3 100755 --- a/.travis-support/cached-bundle +++ b/.travis-support/cached-bundle @@ -24,7 +24,7 @@ compute_md5() { } download() { - curl --tcp-nodelay -qsfL "$1" -o "$2" + curl --tcp-nodelay -qfL "$1" -o "$2" } bundle_path=${CUSTOM_BUNDLE_PATH:-vendor/bundle} @@ -34,6 +34,7 @@ fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cac if download "$fetch_url" "$cache_name"; then echo "Reusing cached bundle ${cache_name}" + ls -l $cache_name tar xzf "$cache_name" fi From 5a488f5e27eeb28d9d2c2dc98863102bc4ef14cc Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 16 Jun 2014 23:06:42 -0700 Subject: [PATCH 065/127] Adding vendor/bundle to simplecov filter --- .simplecov | 1 + 1 file changed, 1 insertion(+) diff --git a/.simplecov b/.simplecov index a8cc950..428ef49 100644 --- a/.simplecov +++ b/.simplecov @@ -1,4 +1,5 @@ SimpleCov.start do coverage_dir "corundum/docs/coverage" add_filter "./spec" + add_filter "vendor/bundle" end From 7926537840970ca26cd15a60c1bbaeb968f81ed5 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 23 Aug 2014 15:21:34 -0700 Subject: [PATCH 066/127] Support for RSpec3 --- Gemfile.lock | 2 +- lib/rspec-steps/duckpunch/example-group.rb | 44 +++-- .../duckpunch/object-extensions.rb | 6 +- lib/rspec-steps/stepwise.rb | 78 +++++++-- .rspec => rspec2.conf | 0 rspec3.conf | 6 + spec/example_group_spec.rb | 20 +-- spec2/example_group_spec.rb | 164 ++++++++++++++++++ spec3_help/file-sandbox.rb | 164 ++++++++++++++++++ spec3_help/gem_test_suite.rb | 17 ++ spec3_help/rspec-sandbox.rb | 68 ++++++++ spec3_help/spec_helper.rb | 3 + spec3_help/ungemmer.rb | 36 ++++ 13 files changed, 563 insertions(+), 45 deletions(-) rename .rspec => rspec2.conf (100%) create mode 100644 rspec3.conf create mode 100644 spec2/example_group_spec.rb create mode 100644 spec3_help/file-sandbox.rb create mode 100644 spec3_help/gem_test_suite.rb create mode 100644 spec3_help/rspec-sandbox.rb create mode 100644 spec3_help/spec_helper.rb create mode 100644 spec3_help/ungemmer.rb diff --git a/Gemfile.lock b/Gemfile.lock index b9afc86..01fe804 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: rspec-steps (0.4.1) - rspec (>= 2.6, < 2.99) + rspec (>= 2.6, < 3.99) GEM remote: https://rubygems.org/ diff --git a/lib/rspec-steps/duckpunch/example-group.rb b/lib/rspec-steps/duckpunch/example-group.rb index 2822297..9f7cdef 100644 --- a/lib/rspec-steps/duckpunch/example-group.rb +++ b/lib/rspec-steps/duckpunch/example-group.rb @@ -1,27 +1,33 @@ require 'rspec/core' require 'rspec-steps/stepwise' -module RSpec::Steps - module DSL - def steps(*args, &block) - options = - if args.last.is_a?(Hash) - args.pop - else - {} - end - options[:stepwise] = true - options[:caller] ||= caller - args.push(options) +if RSpec.configuration.respond_to? :alias_example_group_to + RSpec.configuration.alias_example_group_to :steps, :stepwise => true +else + module RSpec::Steps + module DSL + def steps(*args, &block) + options = + if args.last.is_a?(Hash) + args.pop + else + {} + end + options[:stepwise] = true + options[:caller] ||= caller + args.push(options) - describe(*args, &block) + describe(*args, &block) + end end end -end - -RSpec::Core::ExampleGroup.extend RSpec::Steps::DSL -extend RSpec::Steps::DSL -Module::send(:include, RSpec::Steps::DSL) + [RSpec::Core::ExampleGroup, RSpec, self].each do |mod| + mod.extend RSpec::Steps::DSL + end + Module::send(:include, RSpec::Steps::DSL) +end -RSpec::configuration.include(RSpecStepwise, :stepwise => true) +RSpec::configure do |config| + config.include(RSpecStepwise, :stepwise => true) +end diff --git a/lib/rspec-steps/duckpunch/object-extensions.rb b/lib/rspec-steps/duckpunch/object-extensions.rb index 1174aef..88f74d4 100644 --- a/lib/rspec-steps/duckpunch/object-extensions.rb +++ b/lib/rspec-steps/duckpunch/object-extensions.rb @@ -3,6 +3,8 @@ require 'rspec/core/shared_example_group' module RSpec::Core::SharedExampleGroup - alias :shared_steps :share_examples_for - alias :steps_shared_as :share_as + alias shared_steps shared_examples_for + if respond_to? :share_as + alias steps_shared_as share_as + end end diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 875fedd..ef40b85 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -1,5 +1,12 @@ module RSpecStepwise class ApatheticReporter < ::RSpec::Core::Reporter + def initialize + @examples = [] + @failed_examples = [] + @pending_examples = [] + @duration = @start = @load_time = nil + end + def notify(*args) #noop end @@ -22,10 +29,15 @@ def finish(reporter) def build_example_block #variables of concern: reporter, instance + reporter = @reporter @example_block = proc do begin self.class.filtered_examples.inject(true) do |success, example| - break if RSpec.wants_to_quit + if RSpec.respond_to? :wants_to_quit + break if RSpec.wants_to_quit + else + break if RSpec.world.wants_to_quit + end example.extend StepExample unless success example.metadata[:pending] = true @@ -34,7 +46,13 @@ def build_example_block succeeded = with_indelible_ivars do example.run(self, reporter) end - RSpec.wants_to_quit = true if self.class.fail_fast? && !succeeded + if self.class.fail_fast? && !succeeded + if RSpec.respond_to? :wants_to_quit= + RSpec.wants_to_quit = true + else + RSpec.world.wants_to_quit = true + end + end success && succeeded end end @@ -48,10 +66,12 @@ def run_before_each rescue Object => ex puts "\n#{__FILE__}:#{__LINE__} => #{[ex, ex.backtrace].pretty_inspect}" end + alias run_before_example run_before_each def run_after_each @example_group_class.run_after_step(self) end + alias run_after_example run_after_each def with_around_hooks yield @@ -92,10 +112,18 @@ def build_after_hook(options, &block) end end + def _metadata_from_args(args) + if RSpec::Core::Metadata.respond_to?(:build_hash_from) + RSpec::Core::Metadata.build_hash_from(args) + else + build_metadata_hash_from(args) + end + end + def before(*args, &block) if args.first == :step args.shift - options = build_metadata_hash_from(args) + options = _metadata_from_args(args) return ((hooks[:before][:step] ||= []) << build_before_hook(options, &block)) end if args.first == :each @@ -107,7 +135,7 @@ def before(*args, &block) def after(*args, &block) if args.first == :step args.shift - options = build_metadata_hash_from(args) + options = _metadata_from_args(args) hooks[:after][:step] ||= [] return (hooks[:after][:step].unshift build_after_hook(options, &block)) end @@ -162,32 +190,56 @@ def run_after_step(example) def perform_steps(name, *args, &customization_block) shared_block = nil - if world.respond_to? :shared_example_groups + if respond_to?(:world) and world.respond_to? :shared_example_groups shared_block = world.shared_example_groups[name] else - shared_block = shared_example_groups[name] + if respond_to?(:shared_example_groups) + shared_block = shared_example_groups[name] + else + shared_block = RSpec.world.shared_example_group_registry.find(parent_groups, name) + end end raise "Could not find shared example group named #{name.inspect}" unless shared_block - module_eval_with_args(*args, &shared_block) - module_eval(&customization_block) if customization_block + if respond_to? :module_exec + module_exec(*args, &shared_block) + module_exec(&customization_block) if customization_block + else + module_eval_with_args(*args, &shared_block) + module_eval(&customization_block) if customization_block + end end def run_examples(reporter) whole_list_example = WholeListExample.new(self, "step list", {}) instance = new - set_ivars(instance, before_all_ivars) - instance.example = whole_list_example - instance.reporter = reporter + if respond_to? :before_context_ivars + set_ivars(instance, before_context_ivars) + else + set_ivars(instance, before_all_ivars) + end + instance.example = whole_list_example if respond_to? :example= + instance.reporter = reporter if respond_to? :reporter= result = suspend_transactional_fixtures do whole_list_example.run(instance, reporter) end unless whole_list_example.exception.nil? - RSpec.wants_to_quit = true if fail_fast? - fail_filtered_examples(whole_list_example.exception, reporter) + if fail_fast? + if RSpec.respond_to? :wants_to_quit= + RSpec.wants_to_quit = true + else + RSpec.world.wants_to_quit = true + end + end + if respond_to? :fail_filtered_examples + fail_filtered_examples(whole_list_example.exception, reporter) + else + ex = whole_list_example.exception + for_filtered_examples(reporter) {|example| example.fail_with_exception(reporter, ex) } + end end result diff --git a/.rspec b/rspec2.conf similarity index 100% rename from .rspec rename to rspec2.conf diff --git a/rspec3.conf b/rspec3.conf new file mode 100644 index 0000000..a525713 --- /dev/null +++ b/rspec3.conf @@ -0,0 +1,6 @@ +-I ./spec3_help/interpose +-I ./lib +-I ./spec3_help +--require spec_helper +--pattern *.rb +--color diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index 482cf06..901cc05 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -1,12 +1,12 @@ require 'rspec-steps' require 'rspec-sandbox' -describe RSpec::Core::ExampleGroup, "defined as stepwise" do +describe RSpec::Core::ExampleGroup do describe "::steps" do it "should create an ExampleGroup that includes RSpec::Stepwise" do group = nil sandboxed do - group = steps "Test Steps" do + group = RSpec.steps "Test Steps" do end end (class << group; self; end).included_modules.should include(RSpecStepwise::ClassMethods) @@ -17,7 +17,7 @@ it "should retain instance variables between steps" do group = nil sandboxed do - group = steps "Test Steps" do + group = RSpec.steps "Test Steps" do it("sets @a"){ @a = 1 } it("reads @a"){ @a.should == 1} end @@ -32,7 +32,7 @@ it "should work with shared_steps/perform steps" do group = nil sandboxed do - group = steps "Test Steps" do + group = RSpec.steps "Test Steps" do shared_steps "add one" do it("adds one to @a"){ @a += 1 } end @@ -56,7 +56,7 @@ befores = [] sandboxed do - group = steps "Test Each Step" do + group = RSpec.steps "Test Each Step" do before :each do befores << :each end @@ -104,7 +104,7 @@ exception = Exception.new "Testing Error" sandboxed do - group = steps "Test Steps" do + group = RSpec.steps "Test Steps" do before { raise exception } it { 1.should == 1 } it { 1.should == 1 } @@ -121,20 +121,20 @@ it "should mark later examples as pending if one fails" do group = nil sandboxed do - group = steps "Test Steps" do + group = RSpec.steps "Test Steps" do it { fail "All others fail" } it { 1.should == 1 } end group.run end - group.examples[1].metadata[:pending].should be_true + group.examples[1].metadata[:pending].should == true end it "should allow nested steps", :pending => "Not really" do group = nil sandboxed do - group = steps "Test Steps" do + group = RSpec.steps "Test Steps" do steps "Nested" do it { @a = 1 } it { @a.should == 1} @@ -153,7 +153,7 @@ pending "A correct approach - in the meantime, this behavior is undefined" expect { sandboxed do - steps "Basic" do + RSpec.steps "Basic" do describe "Not allowed" do end end diff --git a/spec2/example_group_spec.rb b/spec2/example_group_spec.rb new file mode 100644 index 0000000..901cc05 --- /dev/null +++ b/spec2/example_group_spec.rb @@ -0,0 +1,164 @@ +require 'rspec-steps' +require 'rspec-sandbox' + +describe RSpec::Core::ExampleGroup do + describe "::steps" do + it "should create an ExampleGroup that includes RSpec::Stepwise" do + group = nil + sandboxed do + group = RSpec.steps "Test Steps" do + end + end + (class << group; self; end).included_modules.should include(RSpecStepwise::ClassMethods) + end + end + + describe "with Stepwise included" do + it "should retain instance variables between steps" do + group = nil + sandboxed do + group = RSpec.steps "Test Steps" do + it("sets @a"){ @a = 1 } + it("reads @a"){ @a.should == 1} + end + group.run + end + + group.examples.each do |example| + example.metadata[:execution_result][:status].should == 'passed' + end + end + + it "should work with shared_steps/perform steps" do + group = nil + sandboxed do + group = RSpec.steps "Test Steps" do + shared_steps "add one" do + it("adds one to @a"){ @a += 1 } + end + it("sets @a"){ @a = 1 } + perform_steps "add one" + perform_steps "add one" + perform_steps "add one" + it("reads @a"){ @a.should == 4 } + end + group.run + end + + group.examples.each do |example| + example.metadata[:execution_result][:status].should == 'passed' + end + end + + it "should run each_step hooks" do + group = nil + afters = [] + befores = [] + + sandboxed do + group = RSpec.steps "Test Each Step" do + before :each do + befores << :each + end + after :each do + afters << :each + end + + before :all do + befores << :all + end + after :all do + afters << :all + end + + before :step do + befores << :step + end + after :step do + afters << :step + end + + it "should 1" do + 1.should == 1 + end + it "should 2" do + 2.should == 2 + end + it "should 3" do + 3.should == 3 + end + end + group.run + end + + befores.find_all{|item| item == :all}.length.should == 1 + befores.find_all{|item| item == :each}.length.should == 1 + befores.find_all{|item| item == :step}.length.should == 3 + afters.find_all{|item| item == :all}.length.should == 1 + afters.find_all{|item| item == :each}.length.should == 1 + afters.find_all{|item| item == :step}.length.should == 3 + end + + it "should mark later examples as failed if a before hook fails" do + group = nil + exception = Exception.new "Testing Error" + + sandboxed do + group = RSpec.steps "Test Steps" do + before { raise exception } + it { 1.should == 1 } + it { 1.should == 1 } + end + group.run + end + + group.examples.each do |example| + example.metadata[:execution_result][:status].should == 'failed' + example.metadata[:execution_result][:exception].should == exception + end + end + + it "should mark later examples as pending if one fails" do + group = nil + sandboxed do + group = RSpec.steps "Test Steps" do + it { fail "All others fail" } + it { 1.should == 1 } + end + group.run + end + + group.examples[1].metadata[:pending].should == true + end + + it "should allow nested steps", :pending => "Not really" do + group = nil + sandboxed do + group = RSpec.steps "Test Steps" do + steps "Nested" do + it { @a = 1 } + it { @a.should == 1} + end + end + group.run + end + + group.children[0].examples.each do |example| + example.metadata[:execution_result][:status].should == 'passed' + end + group.children[0].should have(2).examples + end + + it "should not allow nested normal contexts" do + pending "A correct approach - in the meantime, this behavior is undefined" + expect { + sandboxed do + RSpec.steps "Basic" do + describe "Not allowed" do + end + end + end + }.to raise_error + end + end +end diff --git a/spec3_help/file-sandbox.rb b/spec3_help/file-sandbox.rb new file mode 100644 index 0000000..3d9e326 --- /dev/null +++ b/spec3_help/file-sandbox.rb @@ -0,0 +1,164 @@ +require 'ftools' +require 'fileutils' + +module FileSandbox + def self.included(spec) + return unless spec.respond_to? :before + + spec.before do + setup_sandbox + end + + spec.after do + teardown_sandbox + end + end + + class HaveContents + def initialize(contents) + @contents = contents + end + + def matches?(target) + case @contents + when Regexp + @contents =~ target.contents + when String + @contents == target.contents + end + end + end + + def have_contents(expected) + HaveContents.new(expected) + end + + attr_reader :sandbox + + def in_sandbox(&block) + raise "I expected to create a sandbox as you passed in a block to me" if !block_given? + + setup_sandbox + original_error = nil + + begin + yield @sandbox + rescue => e + original_error = e + raise + ensure + begin + teardown_sandbox + rescue + if original_error + STDERR.puts "ALERT: a test raised an error and failed to release some lock(s) in the sandbox directory" + raise(original_error) + else + raise + end + end + end + end + + def setup_sandbox(path = '__sandbox') + unless @sandbox + @sandbox = Sandbox.new(path) + @__old_path_for_sandbox = Dir.pwd + Dir.chdir(@sandbox.root) + end + end + + def teardown_sandbox + if @sandbox + Dir.chdir(@__old_path_for_sandbox) + @sandbox.clean_up + @sandbox = nil + end + end + + class Sandbox + attr_reader :root + + def initialize(path = '__sandbox') + @root = File.expand_path(path) + clean_up + FileUtils.mkdir_p @root + end + + def [](name) + SandboxFile.new(File.join(@root, name), name) + end + + # usage new :file=>'my file.rb', :with_contents=>'some stuff' + def new(options) + if options.has_key? :directory + dir = self[options.delete(:directory)] + FileUtils.mkdir_p dir.path + else + file = self[options.delete(:file)] + if (binary_content = options.delete(:with_binary_content) || options.delete(:with_binary_contents)) + file.binary_content = binary_content + else + file.content = (options.delete(:with_content) || options.delete(:with_contents) || '') + end + end + + raise "unexpected keys '#{options.keys.join(', ')}'" unless options.empty? + + dir || file + end + + def remove(options) + name = File.join(@root, options[:file]) + FileUtils.remove_file name + end + + def clean_up + FileUtils.rm_rf @root + if File.exists? @root + raise "Could not remove directory #{@root.inspect}, something is probably still holding a lock on it" + end + end + end + + + class SandboxFile + attr_reader :path + + def initialize(path, sandbox_path) + @path = path + @sandbox_path = sandbox_path + end + + def inspect + "SandboxFile: #@sandbox_path" + end + + def exist? + File.exist? path + end + + def content + File.read path + end + + def content=(content) + FileUtils.mkdir_p File.dirname(@path) + File.open(@path, "w") {|f| f << content} + end + + def binary_content=(content) + FileUtils.mkdir_p File.dirname(@path) + File.open(@path, "wb") {|f| f << content} + end + + def create + self.content = '' + end + + alias exists? exist? + alias contents content + alias contents= content= + alias binary_contents= binary_content= + end +end diff --git a/spec3_help/gem_test_suite.rb b/spec3_help/gem_test_suite.rb new file mode 100644 index 0000000..d939b82 --- /dev/null +++ b/spec3_help/gem_test_suite.rb @@ -0,0 +1,17 @@ +puts Dir::pwd +require 'test/unit' +begin + require 'spec' +rescue LoadError + false +end + +class RSpecTest < Test::Unit::TestCase + def test_that_rspec_is_available + assert_nothing_raised("\n\n * RSpec isn't available - please run: gem install rspec *\n\n"){ ::Spec } + end + + def test_that_specs_pass + assert(system(*%w{spec -f e -p **/*.rb spec}),"\n\n * Specs failed *\n\n") + end +end diff --git a/spec3_help/rspec-sandbox.rb b/spec3_help/rspec-sandbox.rb new file mode 100644 index 0000000..fce3dbf --- /dev/null +++ b/spec3_help/rspec-sandbox.rb @@ -0,0 +1,68 @@ +require 'rspec/support/spec' +require 'rspec/core' + +class << RSpec + attr_writer :configuration, :world +end + +$rspec_core_without_stderr_monkey_patch = RSpec::Core::Configuration.new + +class RSpec::Core::Configuration + def self.new(*args, &block) + super.tap do |config| + # We detect ruby warnings via $stderr, + # so direct our deprecations to $stdout instead. + config.deprecation_stream = $stdout + end + end +end + +module Sandboxing + def sandboxed(&block) + @orig_config = RSpec.configuration + @orig_world = RSpec.world + @orig_example = RSpec.current_example + new_config = RSpec::Core::Configuration.new + new_config.expose_dsl_globally = false + new_config.expecting_with_rspec = true + new_config.include(RSpecStepwise, :stepwise => true) + new_world = RSpec::Core::World.new(new_config) + RSpec.configuration = new_config + RSpec.world = new_world + object = Object.new + object.extend(RSpec::Core::SharedExampleGroup) + + (class << RSpec::Core::ExampleGroup; self; end).class_exec do + alias_method :orig_run, :run + def run(reporter=nil) + RSpec.current_example = nil + orig_run(reporter || NullObject.new) + end + end + + RSpec::Mocks.with_temporary_scope do + object.instance_exec(&block) + end + ensure + (class << RSpec::Core::ExampleGroup; self; end).class_exec do + remove_method :run + alias_method :run, :orig_run + remove_method :orig_run + end + + RSpec.configuration = @orig_config + RSpec.world = @orig_world + RSpec.current_example = @orig_example + end +end + +RSpec.configure do |config| + config.include Sandboxing +end + +class NullObject + private + def method_missing(method, *args, &block) + # ignore + end +end diff --git a/spec3_help/spec_helper.rb b/spec3_help/spec_helper.rb new file mode 100644 index 0000000..88cb728 --- /dev/null +++ b/spec3_help/spec_helper.rb @@ -0,0 +1,3 @@ +require 'rspec' + +#Ungemmer::ungem_gemspec diff --git a/spec3_help/ungemmer.rb b/spec3_help/ungemmer.rb new file mode 100644 index 0000000..91db63a --- /dev/null +++ b/spec3_help/ungemmer.rb @@ -0,0 +1,36 @@ +class Ungemmer + def self.ungem(*names) + deps = names.map do |name| + Gem::Dependency.new(name, nil) + end + + deps.each do |dep| + Gem.source_index.search(dep).each do |gemspec| + puts " ** Ungemming #{gemspec.full_name} **" + Gem.source_index.remove_spec(gemspec.full_name) + end + end + + Gem.instance_eval do + if defined? Gem::MUTEX + Gem::MUTEX.synchronize do + @searcher = nil + end + else + @searcher = nil + end + end + end + + def self.ungem_gemspec + Dir[File::expand_path(__FILE__ + "../../../*.gemspec")].each do |gemspec_path| + puts "Ungemming based on #{gemspec_path}" + begin + spec = Gem::Specification::load(gemspec_path) + Ungemmer::ungem(spec) + rescue LoadError + puts "Couldn't load #{gemspec_path}" + end + end + end +end From 5a4e9b75eabfdbeb9a06e526fa8ce06cadd56569 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 23 Aug 2014 15:46:46 -0700 Subject: [PATCH 067/127] transpec result and cleanup --- {spec => spec3}/example_group_spec.rb | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {spec => spec3}/example_group_spec.rb (77%) diff --git a/spec/example_group_spec.rb b/spec3/example_group_spec.rb similarity index 77% rename from spec/example_group_spec.rb rename to spec3/example_group_spec.rb index 901cc05..d142f4e 100644 --- a/spec/example_group_spec.rb +++ b/spec3/example_group_spec.rb @@ -9,7 +9,7 @@ group = RSpec.steps "Test Steps" do end end - (class << group; self; end).included_modules.should include(RSpecStepwise::ClassMethods) + expect((class << group; self; end).included_modules).to include(RSpecStepwise::ClassMethods) end end @@ -25,7 +25,7 @@ end group.examples.each do |example| - example.metadata[:execution_result][:status].should == 'passed' + expect(example.metadata[:execution_result].status).to eq(:passed) end end @@ -46,7 +46,7 @@ end group.examples.each do |example| - example.metadata[:execution_result][:status].should == 'passed' + expect(example.metadata[:execution_result].status).to eq(:passed) end end @@ -91,12 +91,12 @@ group.run end - befores.find_all{|item| item == :all}.length.should == 1 - befores.find_all{|item| item == :each}.length.should == 1 - befores.find_all{|item| item == :step}.length.should == 3 - afters.find_all{|item| item == :all}.length.should == 1 - afters.find_all{|item| item == :each}.length.should == 1 - afters.find_all{|item| item == :step}.length.should == 3 + expect(befores.find_all{|item| item == :all}.length).to eq(1) + expect(befores.find_all{|item| item == :each}.length).to eq(1) + expect(befores.find_all{|item| item == :step}.length).to eq(3) + expect(afters.find_all{|item| item == :all}.length).to eq(1) + expect(afters.find_all{|item| item == :each}.length).to eq(1) + expect(afters.find_all{|item| item == :step}.length).to eq(3) end it "should mark later examples as failed if a before hook fails" do @@ -113,8 +113,8 @@ end group.examples.each do |example| - example.metadata[:execution_result][:status].should == 'failed' - example.metadata[:execution_result][:exception].should == exception + expect(example.metadata[:execution_result].status).to eq(:failed) + expect(example.metadata[:execution_result].exception).to eq(exception) end end @@ -128,7 +128,7 @@ group.run end - group.examples[1].metadata[:pending].should == true + expect(group.examples[1].metadata[:pending]).to eq(true) end it "should allow nested steps", :pending => "Not really" do @@ -144,9 +144,9 @@ end group.children[0].examples.each do |example| - example.metadata[:execution_result][:status].should == 'passed' + expect(example.metadata[:execution_result].status).to eq(:passed) end - group.children[0].should have(2).examples + expect(group.children[0].size).to eq(2) end it "should not allow nested normal contexts" do From 668db864762eab4ad2e89bd14a1c32340344dedd Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 23 Aug 2014 16:11:05 -0700 Subject: [PATCH 068/127] Update to CI scripts --- .travis.yml | 15 ++++++++++----- Rakefile | 10 +++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c2d9a9..d0931be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,16 @@ language: ruby script: bundle exec rake ci install: .travis-support/cached-bundle install --deployment -gemfile: -- gemfiles/2.6 -- gemfiles/2.10 -- gemfiles/2.14 -- gemfiles/3.0 +matrix: + include: + - gemfile: gemfiles/2.6 + env: TARGET_RSPEC=2 + - gemfile: gemfiles/2.10 + env: TARGET_RSPEC=2 + - gemfile: gemfiles/2.14 + env: TARGET_RSPEC=2 + - gemfile: gemfiles/3.0 + env: TARGET_RSPEC=3 rvm: - 1.9.3 - 2.0.0 diff --git a/Rakefile b/Rakefile index dff8cf9..0a9dee1 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,15 @@ module Corundum end end - rspec = RSpec.new(tk) + rspec = RSpec.new(tk) do |rspec| + if ENV[TARGET_RSPEC]="3" + rspec.rspec_opts << "-O rspec3.conf" + rspec.files_to_run = "spec3" + else + rspec.rspec_opts << "-O rspec2.conf" + rspec.files_to_run = "spec2" + end + end cov = SimpleCov.new(tk, rspec) do |cov| cov.threshold = 80 end From 794c3e198f891cd45c0a3a35b3f71cb6fc9f048a Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 23 Aug 2014 16:20:54 -0700 Subject: [PATCH 069/127] Travis config --- .travis.yml | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d0931be..1129615 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,42 @@ matrix: include: - gemfile: gemfiles/2.6 env: TARGET_RSPEC=2 + rvm: 1.9.3 - gemfile: gemfiles/2.10 env: TARGET_RSPEC=2 + rvm: 1.9.3 - gemfile: gemfiles/2.14 env: TARGET_RSPEC=2 + rvm: 1.9.3 - gemfile: gemfiles/3.0 env: TARGET_RSPEC=3 -rvm: -- 1.9.3 -- 2.0.0 -- 2.1.0 + rvm: 1.9.3 + + - gemfile: gemfiles/2.6 + env: TARGET_RSPEC=2 + rvm: 2.0.0 + - gemfile: gemfiles/2.10 + env: TARGET_RSPEC=2 + rvm: 2.0.0 + - gemfile: gemfiles/2.14 + env: TARGET_RSPEC=2 + rvm: 2.0.0 + - gemfile: gemfiles/3.0 + env: TARGET_RSPEC=3 + rvm: 2.0.0 + + - gemfile: gemfiles/2.6 + env: TARGET_RSPEC=2 + rvm: 2.1.0 + - gemfile: gemfiles/2.10 + env: TARGET_RSPEC=2 + rvm: 2.1.0 + - gemfile: gemfiles/2.14 + env: TARGET_RSPEC=2 + rvm: 2.1.0 + - gemfile: gemfiles/3.0 + env: TARGET_RSPEC=3 + rvm: 2.1.0 env: global: - CUSTOM_BUNDLE_PATH=gemfiles/vendor/bundle AMAZON_S3_BUCKET=lrd-travis-caching From 427b4bf4af291bc7ceff1757bfd81750c1bf748f Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 23 Aug 2014 16:24:10 -0700 Subject: [PATCH 070/127] Travis fix --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 0a9dee1..d0d9f2c 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,7 @@ module Corundum end rspec = RSpec.new(tk) do |rspec| - if ENV[TARGET_RSPEC]="3" + if ENV["TARGET_RSPEC"]="3" rspec.rspec_opts << "-O rspec3.conf" rspec.files_to_run = "spec3" else From a08cae6d9971d054814270a6fafab654165f895b Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 23 Aug 2014 16:26:59 -0700 Subject: [PATCH 071/127] Travis fix --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index d0d9f2c..ac7684c 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,7 @@ module Corundum end rspec = RSpec.new(tk) do |rspec| - if ENV["TARGET_RSPEC"]="3" + if ENV["TARGET_RSPEC"]=="3" rspec.rspec_opts << "-O rspec3.conf" rspec.files_to_run = "spec3" else From 9f5e83cf5cd9af8424132f085c5b82c110ebea4f Mon Sep 17 00:00:00 2001 From: Judson Date: Sun, 24 Aug 2014 22:37:19 -0700 Subject: [PATCH 072/127] Travis fix --- .simplecov | 6 ++++++ Rakefile | 12 ++++-------- gemfiles/3.0 | 1 + gemfiles/3.0.lock | 46 ++++++++++++++++----------------------------- rspec-steps.gemspec | 12 +++++++++--- 5 files changed, 36 insertions(+), 41 deletions(-) diff --git a/.simplecov b/.simplecov index 428ef49..2de77b1 100644 --- a/.simplecov +++ b/.simplecov @@ -1,5 +1,11 @@ +require 'simplecov-json' + SimpleCov.start do coverage_dir "corundum/docs/coverage" add_filter "./spec" add_filter "vendor/bundle" + formatter SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::JSONFormatter + ] end diff --git a/Rakefile b/Rakefile index ac7684c..12e70a6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,13 @@ require 'corundum/tasklibs' -require 'mattock/yard_extensions' +#require 'mattock/yard_extensions' module Corundum register_project(__FILE__) tk = Toolkit.new do |tk| tk.file_lists.project = [__FILE__] + tk.file_lists.test << FileList["spec2/**/*.rb"] + tk.file_lists.test << FileList["spec3/**/*.rb"] end tk.in_namespace do @@ -26,19 +28,13 @@ module Corundum end end cov = SimpleCov.new(tk, rspec) do |cov| - cov.threshold = 80 + cov.threshold = 75 end gem = GemBuilding.new(tk) cutter = GemCutter.new(tk,gem) - email = Email.new(tk) vc = Git.new(tk) do |vc| vc.branch = "master" end - task tk.finished_files.build => vc["is_checked_in"] - yd = YARDoc.new(tk) do |yd| - end - all_docs = DocumentationAssembly.new(tk, yd, rspec, cov) - pages = GithubPages.new(all_docs) end end diff --git a/gemfiles/3.0 b/gemfiles/3.0 index 5e3fdb2..0915dc1 100644 --- a/gemfiles/3.0 +++ b/gemfiles/3.0 @@ -1,5 +1,6 @@ source "https://rubygems.org" gem "rspec", "~> 3.0.0" +gem "corundum", ">= 0.4.0" gemspec :path => ".." diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 5717f97..d08e6b0 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -7,67 +7,53 @@ PATH GEM remote: https://rubygems.org/ specs: - chunky_png (1.3.1) - compass (0.12.6) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.2.19) - corundum (0.3.7) + caliph (0.3.1) + corundum (0.4.1) bundler - compass (>= 0.12.1) - mailfactory (~> 1.4.0) - mattock (~> 0.7.1) - nokogiri + caliph (~> 0.3) + mattock (~> 0.9) paint (~> 0.8.7) - rdoc rspec (>= 2.0) simplecov (>= 0.5.4) - yard + simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) - fssm (0.2.10) json (1.8.1) - mailfactory (1.4.0) - mime-types (>= 1.13.1) - mattock (0.7.1) + mattock (0.9.0) + caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - mime-types (2.3) - mini_portile (0.6.0) multi_json (1.10.1) - nokogiri (1.6.2.1) - mini_portile (= 0.6.0) paint (0.8.7) rake (10.3.2) - rdoc (4.1.1) - json (~> 1.4) rspec (3.0.0) rspec-core (~> 3.0.0) rspec-expectations (~> 3.0.0) rspec-mocks (~> 3.0.0) - rspec-core (3.0.1) + rspec-core (3.0.4) rspec-support (~> 3.0.0) - rspec-expectations (3.0.1) + rspec-expectations (3.0.4) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.0.0) - rspec-mocks (3.0.1) + rspec-mocks (3.0.4) rspec-support (~> 3.0.0) - rspec-support (3.0.0) - sass (3.2.19) - simplecov (0.8.2) + rspec-support (3.0.4) + simplecov (0.9.0) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + simplecov-json (0.2) + json + simplecov tilt (2.0.1) valise (1.1.1) - yard (0.8.7.4) PLATFORMS ruby DEPENDENCIES - corundum (>= 0.0.25) + corundum (>= 0.4.0) rspec (~> 3.0.0) rspec-steps! diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 83b4fed..ecbc33d 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -29,21 +29,27 @@ Gem::Specification.new do |spec| lib/rspec-steps/duckpunch/object-extensions.rb doc/README doc/Specifications - spec/example_group_spec.rb + spec2/example_group_spec.rb + spec3/example_group_spec.rb spec_help/spec_helper.rb spec_help/gem_test_suite.rb spec_help/rspec-sandbox.rb spec_help/ungemmer.rb spec_help/file-sandbox.rb + spec3_help/spec_helper.rb + spec3_help/gem_test_suite.rb + spec3_help/rspec-sandbox.rb + spec3_help/ungemmer.rb + spec3_help/file-sandbox.rb ] - spec.test_file = "spec_help/gem_test_suite.rb" + spec.test_file = "spec3_help/gem_test_suite.rb" spec.licenses = ["MIT"] spec.require_paths = %w[lib/] spec.rubygems_version = "1.3.5" dev_deps = [ - ["corundum", ">= 0.0.25"], + ["corundum", "0.4.0"], ] if spec.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION From 7511419f9897c1d4219bbfdaebd332e9cb24adbb Mon Sep 17 00:00:00 2001 From: Judson Date: Sun, 24 Aug 2014 23:15:55 -0700 Subject: [PATCH 073/127] Travis gemfile caching fix --- gemfiles/2.10 | 1 + gemfiles/2.14 | 1 + gemfiles/2.6 | 1 + 3 files changed, 3 insertions(+) diff --git a/gemfiles/2.10 b/gemfiles/2.10 index 4a62d31..2e2f8ff 100644 --- a/gemfiles/2.10 +++ b/gemfiles/2.10 @@ -2,4 +2,5 @@ source "https://rubygems.org" gem "rspec", "~> 2.10.0" + gemspec :path => ".." diff --git a/gemfiles/2.14 b/gemfiles/2.14 index 952c48a..8f1c81e 100644 --- a/gemfiles/2.14 +++ b/gemfiles/2.14 @@ -2,4 +2,5 @@ source "https://rubygems.org" gem "rspec", "~> 2.14.0" + gemspec :path => ".." diff --git a/gemfiles/2.6 b/gemfiles/2.6 index e91c931..4aac5b8 100644 --- a/gemfiles/2.6 +++ b/gemfiles/2.6 @@ -2,4 +2,5 @@ source "https://rubygems.org" gem "rspec", "~> 2.6.0" + gemspec :path => ".." From 47ee12582d6e7cb79e835e1976b5724a96004f80 Mon Sep 17 00:00:00 2001 From: Judson Date: Sun, 24 Aug 2014 23:25:22 -0700 Subject: [PATCH 074/127] Updating gemfile/*.lock + added 2.8 --- gemfiles/2.10.lock | 38 ++++++++++---------------------- gemfiles/2.14.lock | 38 ++++++++++---------------------- gemfiles/2.6.lock | 38 ++++++++++---------------------- gemfiles/2.8 | 6 +++++ gemfiles/2.8.lock | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+), 78 deletions(-) create mode 100644 gemfiles/2.8 create mode 100644 gemfiles/2.8.lock diff --git a/gemfiles/2.10.lock b/gemfiles/2.10.lock index d3f1f99..3c86c68 100644 --- a/gemfiles/2.10.lock +++ b/gemfiles/2.10.lock @@ -7,41 +7,26 @@ PATH GEM remote: https://rubygems.org/ specs: - chunky_png (1.3.1) - compass (0.12.6) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.2.19) - corundum (0.3.7) + caliph (0.3.1) + corundum (0.4.0) bundler - compass (>= 0.12.1) - mailfactory (~> 1.4.0) - mattock (~> 0.7.1) - nokogiri + caliph (~> 0.3) + mattock (~> 0.9) paint (~> 0.8.7) - rdoc rspec (>= 2.0) simplecov (>= 0.5.4) - yard + simplecov-json (>= 0.2) diff-lcs (1.1.3) docile (1.1.5) - fssm (0.2.10) json (1.8.1) - mailfactory (1.4.0) - mime-types (>= 1.13.1) - mattock (0.7.1) + mattock (0.9.0) + caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - mime-types (2.3) - mini_portile (0.6.0) multi_json (1.10.1) - nokogiri (1.6.2.1) - mini_portile (= 0.6.0) paint (0.8.7) rake (10.3.2) - rdoc (4.1.1) - json (~> 1.4) rspec (2.10.0) rspec-core (~> 2.10.0) rspec-expectations (~> 2.10.0) @@ -50,20 +35,21 @@ GEM rspec-expectations (2.10.0) diff-lcs (~> 1.1.3) rspec-mocks (2.10.1) - sass (3.2.19) - simplecov (0.8.2) + simplecov (0.9.0) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + simplecov-json (0.2) + json + simplecov tilt (2.0.1) valise (1.1.1) - yard (0.8.7.4) PLATFORMS ruby DEPENDENCIES - corundum (>= 0.0.25) + corundum (= 0.4.0) rspec (~> 2.10.0) rspec-steps! diff --git a/gemfiles/2.14.lock b/gemfiles/2.14.lock index 41138e1..8dc7b3a 100644 --- a/gemfiles/2.14.lock +++ b/gemfiles/2.14.lock @@ -7,41 +7,26 @@ PATH GEM remote: https://rubygems.org/ specs: - chunky_png (1.3.1) - compass (0.12.6) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.2.19) - corundum (0.3.7) + caliph (0.3.1) + corundum (0.4.0) bundler - compass (>= 0.12.1) - mailfactory (~> 1.4.0) - mattock (~> 0.7.1) - nokogiri + caliph (~> 0.3) + mattock (~> 0.9) paint (~> 0.8.7) - rdoc rspec (>= 2.0) simplecov (>= 0.5.4) - yard + simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) - fssm (0.2.10) json (1.8.1) - mailfactory (1.4.0) - mime-types (>= 1.13.1) - mattock (0.7.1) + mattock (0.9.0) + caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - mime-types (2.3) - mini_portile (0.6.0) multi_json (1.10.1) - nokogiri (1.6.2.1) - mini_portile (= 0.6.0) paint (0.8.7) rake (10.3.2) - rdoc (4.1.1) - json (~> 1.4) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) @@ -50,20 +35,21 @@ GEM rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.6) - sass (3.2.19) - simplecov (0.8.2) + simplecov (0.9.0) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + simplecov-json (0.2) + json + simplecov tilt (2.0.1) valise (1.1.1) - yard (0.8.7.4) PLATFORMS ruby DEPENDENCIES - corundum (>= 0.0.25) + corundum (= 0.4.0) rspec (~> 2.14.0) rspec-steps! diff --git a/gemfiles/2.6.lock b/gemfiles/2.6.lock index 330763c..dadfca8 100644 --- a/gemfiles/2.6.lock +++ b/gemfiles/2.6.lock @@ -7,41 +7,26 @@ PATH GEM remote: https://rubygems.org/ specs: - chunky_png (1.3.1) - compass (0.12.6) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.2.19) - corundum (0.3.7) + caliph (0.3.1) + corundum (0.4.0) bundler - compass (>= 0.12.1) - mailfactory (~> 1.4.0) - mattock (~> 0.7.1) - nokogiri + caliph (~> 0.3) + mattock (~> 0.9) paint (~> 0.8.7) - rdoc rspec (>= 2.0) simplecov (>= 0.5.4) - yard + simplecov-json (>= 0.2) diff-lcs (1.1.3) docile (1.1.5) - fssm (0.2.10) json (1.8.1) - mailfactory (1.4.0) - mime-types (>= 1.13.1) - mattock (0.7.1) + mattock (0.9.0) + caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - mime-types (2.3) - mini_portile (0.6.0) multi_json (1.10.1) - nokogiri (1.6.2.1) - mini_portile (= 0.6.0) paint (0.8.7) rake (10.3.2) - rdoc (4.1.1) - json (~> 1.4) rspec (2.6.0) rspec-core (~> 2.6.0) rspec-expectations (~> 2.6.0) @@ -50,20 +35,21 @@ GEM rspec-expectations (2.6.0) diff-lcs (~> 1.1.2) rspec-mocks (2.6.0) - sass (3.2.19) - simplecov (0.8.2) + simplecov (0.9.0) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + simplecov-json (0.2) + json + simplecov tilt (2.0.1) valise (1.1.1) - yard (0.8.7.4) PLATFORMS ruby DEPENDENCIES - corundum (>= 0.0.25) + corundum (= 0.4.0) rspec (~> 2.6.0) rspec-steps! diff --git a/gemfiles/2.8 b/gemfiles/2.8 new file mode 100644 index 0000000..71e8b6f --- /dev/null +++ b/gemfiles/2.8 @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "rspec", "~> 2.8.0" + + +gemspec :path => ".." diff --git a/gemfiles/2.8.lock b/gemfiles/2.8.lock new file mode 100644 index 0000000..b8bba4a --- /dev/null +++ b/gemfiles/2.8.lock @@ -0,0 +1,55 @@ +PATH + remote: .. + specs: + rspec-steps (0.4.1) + rspec (>= 2.6, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + caliph (0.3.1) + corundum (0.4.0) + bundler + caliph (~> 0.3) + mattock (~> 0.9) + paint (~> 0.8.7) + rspec (>= 2.0) + simplecov (>= 0.5.4) + simplecov-json (>= 0.2) + diff-lcs (1.1.3) + docile (1.1.5) + json (1.8.1) + mattock (0.9.0) + caliph (~> 0.3.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + multi_json (1.10.1) + paint (0.8.7) + rake (10.3.2) + rspec (2.8.0) + rspec-core (~> 2.8.0) + rspec-expectations (~> 2.8.0) + rspec-mocks (~> 2.8.0) + rspec-core (2.8.0) + rspec-expectations (2.8.0) + diff-lcs (~> 1.1.2) + rspec-mocks (2.8.0) + simplecov (0.9.0) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + simplecov-json (0.2) + json + simplecov + tilt (2.0.1) + valise (1.1.1) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (= 0.4.0) + rspec (~> 2.8.0) + rspec-steps! From 9ed89cc8e1ee4de9f509d0c4491e5a230d636691 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 25 Aug 2014 10:16:12 -0700 Subject: [PATCH 075/127] Updating gemfiles --- gemfiles/2.10.lock | 99 ++++++++++++++++++++++++++++++++++++++++++++- gemfiles/2.14.lock | 99 ++++++++++++++++++++++++++++++++++++++++++++- gemfiles/2.6.lock | 99 ++++++++++++++++++++++++++++++++++++++++++++- gemfiles/2.8.lock | 99 ++++++++++++++++++++++++++++++++++++++++++++- gemfiles/3.0 | 1 - gemfiles/3.0.lock | 97 ++++++++++++++++++++++++++++++++++++++++++++ rspec-steps.gemspec | 3 +- 7 files changed, 491 insertions(+), 6 deletions(-) diff --git a/gemfiles/2.10.lock b/gemfiles/2.10.lock index 3c86c68..c5fa4dc 100644 --- a/gemfiles/2.10.lock +++ b/gemfiles/2.10.lock @@ -7,7 +7,32 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (4.1.4) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + addressable (2.3.6) + arrayfields (4.9.2) + awesome_print (1.2.0) caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) corundum (0.4.0) bundler caliph (~> 0.3) @@ -18,15 +43,76 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.1.3) docile (1.1.5) + erubis (2.7.0) + fattr (2.2.2) + flay (2.5.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.2) + i18n (0.6.11) json (1.8.1) + json_pure (1.8.1) + launchy (2.4.2) + addressable (~> 2.3) + main (6.0.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.4) mattock (0.9.0) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) + metric_fu (4.11.1) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.3) + minitest (5.4.0) multi_json (1.10.1) + netrc (0.7.7) paint (0.8.7) + parallel (1.1.2) + rails_best_practices (1.15.4) + activesupport + awesome_print + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) rake (10.3.2) + redcard (1.1.0) + reek (1.3.8) + rainbow (>= 1.99, < 3.0) + ruby2ruby (>= 2.0.8, < 3.0) + ruby_parser (~> 3.3) + sexp_processor + require_all (1.3.2) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) rspec (2.10.0) rspec-core (~> 2.10.0) rspec-expectations (~> 2.10.0) @@ -35,6 +121,13 @@ GEM rspec-expectations (2.10.0) diff-lcs (~> 1.1.3) rspec-mocks (2.10.1) + ruby-progressbar (1.5.1) + ruby2ruby (2.1.1) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.6.2) + sexp_processor (~> 4.1) + sexp_processor (4.4.3) simplecov (0.9.0) docile (~> 1.1.0) multi_json @@ -43,13 +136,17 @@ GEM simplecov-json (0.2) json simplecov + thread_safe (0.3.4) tilt (2.0.1) + tzinfo (1.2.1) + thread_safe (~> 0.1) valise (1.1.1) PLATFORMS ruby DEPENDENCIES - corundum (= 0.4.0) + corundum (>= 0.4.0) + metric_fu (~> 4.11.1) rspec (~> 2.10.0) rspec-steps! diff --git a/gemfiles/2.14.lock b/gemfiles/2.14.lock index 8dc7b3a..8c0d4bb 100644 --- a/gemfiles/2.14.lock +++ b/gemfiles/2.14.lock @@ -7,7 +7,32 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (4.1.4) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + addressable (2.3.6) + arrayfields (4.9.2) + awesome_print (1.2.0) caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) corundum (0.4.0) bundler caliph (~> 0.3) @@ -18,15 +43,76 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) + erubis (2.7.0) + fattr (2.2.2) + flay (2.5.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.2) + i18n (0.6.11) json (1.8.1) + json_pure (1.8.1) + launchy (2.4.2) + addressable (~> 2.3) + main (6.0.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.4) mattock (0.9.0) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) + metric_fu (4.11.1) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.3) + minitest (5.4.0) multi_json (1.10.1) + netrc (0.7.7) paint (0.8.7) + parallel (1.1.2) + rails_best_practices (1.15.4) + activesupport + awesome_print + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) rake (10.3.2) + redcard (1.1.0) + reek (1.3.8) + rainbow (>= 1.99, < 3.0) + ruby2ruby (>= 2.0.8, < 3.0) + ruby_parser (~> 3.3) + sexp_processor + require_all (1.3.2) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) @@ -35,6 +121,13 @@ GEM rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.6) + ruby-progressbar (1.5.1) + ruby2ruby (2.1.1) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.6.2) + sexp_processor (~> 4.1) + sexp_processor (4.4.3) simplecov (0.9.0) docile (~> 1.1.0) multi_json @@ -43,13 +136,17 @@ GEM simplecov-json (0.2) json simplecov + thread_safe (0.3.4) tilt (2.0.1) + tzinfo (1.2.1) + thread_safe (~> 0.1) valise (1.1.1) PLATFORMS ruby DEPENDENCIES - corundum (= 0.4.0) + corundum (>= 0.4.0) + metric_fu (~> 4.11.1) rspec (~> 2.14.0) rspec-steps! diff --git a/gemfiles/2.6.lock b/gemfiles/2.6.lock index dadfca8..f6d00ec 100644 --- a/gemfiles/2.6.lock +++ b/gemfiles/2.6.lock @@ -7,7 +7,32 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (4.1.4) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + addressable (2.3.6) + arrayfields (4.9.2) + awesome_print (1.2.0) caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) corundum (0.4.0) bundler caliph (~> 0.3) @@ -18,15 +43,76 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.1.3) docile (1.1.5) + erubis (2.7.0) + fattr (2.2.2) + flay (2.5.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.2) + i18n (0.6.11) json (1.8.1) + json_pure (1.8.1) + launchy (2.4.2) + addressable (~> 2.3) + main (6.0.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.4) mattock (0.9.0) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) + metric_fu (4.11.1) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.3) + minitest (5.4.0) multi_json (1.10.1) + netrc (0.7.7) paint (0.8.7) + parallel (1.1.2) + rails_best_practices (1.15.4) + activesupport + awesome_print + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) rake (10.3.2) + redcard (1.1.0) + reek (1.3.8) + rainbow (>= 1.99, < 3.0) + ruby2ruby (>= 2.0.8, < 3.0) + ruby_parser (~> 3.3) + sexp_processor + require_all (1.3.2) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) rspec (2.6.0) rspec-core (~> 2.6.0) rspec-expectations (~> 2.6.0) @@ -35,6 +121,13 @@ GEM rspec-expectations (2.6.0) diff-lcs (~> 1.1.2) rspec-mocks (2.6.0) + ruby-progressbar (1.5.1) + ruby2ruby (2.1.1) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.6.2) + sexp_processor (~> 4.1) + sexp_processor (4.4.3) simplecov (0.9.0) docile (~> 1.1.0) multi_json @@ -43,13 +136,17 @@ GEM simplecov-json (0.2) json simplecov + thread_safe (0.3.4) tilt (2.0.1) + tzinfo (1.2.1) + thread_safe (~> 0.1) valise (1.1.1) PLATFORMS ruby DEPENDENCIES - corundum (= 0.4.0) + corundum (>= 0.4.0) + metric_fu (~> 4.11.1) rspec (~> 2.6.0) rspec-steps! diff --git a/gemfiles/2.8.lock b/gemfiles/2.8.lock index b8bba4a..4401e2b 100644 --- a/gemfiles/2.8.lock +++ b/gemfiles/2.8.lock @@ -7,7 +7,32 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (4.1.4) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + addressable (2.3.6) + arrayfields (4.9.2) + awesome_print (1.2.0) caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) corundum (0.4.0) bundler caliph (~> 0.3) @@ -18,15 +43,76 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.1.3) docile (1.1.5) + erubis (2.7.0) + fattr (2.2.2) + flay (2.5.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.2) + i18n (0.6.11) json (1.8.1) + json_pure (1.8.1) + launchy (2.4.2) + addressable (~> 2.3) + main (6.0.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.4) mattock (0.9.0) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) + metric_fu (4.11.1) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.3) + minitest (5.4.0) multi_json (1.10.1) + netrc (0.7.7) paint (0.8.7) + parallel (1.1.2) + rails_best_practices (1.15.4) + activesupport + awesome_print + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) rake (10.3.2) + redcard (1.1.0) + reek (1.3.8) + rainbow (>= 1.99, < 3.0) + ruby2ruby (>= 2.0.8, < 3.0) + ruby_parser (~> 3.3) + sexp_processor + require_all (1.3.2) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) rspec (2.8.0) rspec-core (~> 2.8.0) rspec-expectations (~> 2.8.0) @@ -35,6 +121,13 @@ GEM rspec-expectations (2.8.0) diff-lcs (~> 1.1.2) rspec-mocks (2.8.0) + ruby-progressbar (1.5.1) + ruby2ruby (2.1.1) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.6.2) + sexp_processor (~> 4.1) + sexp_processor (4.4.3) simplecov (0.9.0) docile (~> 1.1.0) multi_json @@ -43,13 +136,17 @@ GEM simplecov-json (0.2) json simplecov + thread_safe (0.3.4) tilt (2.0.1) + tzinfo (1.2.1) + thread_safe (~> 0.1) valise (1.1.1) PLATFORMS ruby DEPENDENCIES - corundum (= 0.4.0) + corundum (>= 0.4.0) + metric_fu (~> 4.11.1) rspec (~> 2.8.0) rspec-steps! diff --git a/gemfiles/3.0 b/gemfiles/3.0 index 0915dc1..5e3fdb2 100644 --- a/gemfiles/3.0 +++ b/gemfiles/3.0 @@ -1,6 +1,5 @@ source "https://rubygems.org" gem "rspec", "~> 3.0.0" -gem "corundum", ">= 0.4.0" gemspec :path => ".." diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index d08e6b0..6369fd6 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -7,7 +7,32 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (4.1.4) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + addressable (2.3.6) + arrayfields (4.9.2) + awesome_print (1.2.0) caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) corundum (0.4.1) bundler caliph (~> 0.3) @@ -18,15 +43,76 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) + erubis (2.7.0) + fattr (2.2.2) + flay (2.5.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.2) + i18n (0.6.11) json (1.8.1) + json_pure (1.8.1) + launchy (2.4.2) + addressable (~> 2.3) + main (6.0.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.4) mattock (0.9.0) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) + metric_fu (4.11.1) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.3) + minitest (5.4.0) multi_json (1.10.1) + netrc (0.7.7) paint (0.8.7) + parallel (1.1.2) + rails_best_practices (1.15.4) + activesupport + awesome_print + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) rake (10.3.2) + redcard (1.1.0) + reek (1.3.8) + rainbow (>= 1.99, < 3.0) + ruby2ruby (>= 2.0.8, < 3.0) + ruby_parser (~> 3.3) + sexp_processor + require_all (1.3.2) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) rspec (3.0.0) rspec-core (~> 3.0.0) rspec-expectations (~> 3.0.0) @@ -39,6 +125,13 @@ GEM rspec-mocks (3.0.4) rspec-support (~> 3.0.0) rspec-support (3.0.4) + ruby-progressbar (1.5.1) + ruby2ruby (2.1.1) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.6.2) + sexp_processor (~> 4.1) + sexp_processor (4.4.3) simplecov (0.9.0) docile (~> 1.1.0) multi_json @@ -47,7 +140,10 @@ GEM simplecov-json (0.2) json simplecov + thread_safe (0.3.4) tilt (2.0.1) + tzinfo (1.2.1) + thread_safe (~> 0.1) valise (1.1.1) PLATFORMS @@ -55,5 +151,6 @@ PLATFORMS DEPENDENCIES corundum (>= 0.4.0) + metric_fu (~> 4.11.1) rspec (~> 3.0.0) rspec-steps! diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index ecbc33d..ffa4c1a 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -49,7 +49,8 @@ Gem::Specification.new do |spec| spec.rubygems_version = "1.3.5" dev_deps = [ - ["corundum", "0.4.0"], + ["corundum", ">= 0.4.0"], + ["metric_fu", "~> 4.11.1"], ] if spec.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION From 5ea8bfdb6df6aebfb9f887d322656b3e0d817057 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 25 Aug 2014 10:25:37 -0700 Subject: [PATCH 076/127] Adding 2.8 to matrix --- .travis.yml | 9 ++++ Gemfile.lock | 144 ++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 123 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1129615..783e5d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ matrix: - gemfile: gemfiles/2.6 env: TARGET_RSPEC=2 rvm: 1.9.3 + - gemfile: gemfiles/2.8 + env: TARGET_RSPEC=2 + rvm: 1.9.3 - gemfile: gemfiles/2.10 env: TARGET_RSPEC=2 rvm: 1.9.3 @@ -19,6 +22,9 @@ matrix: - gemfile: gemfiles/2.6 env: TARGET_RSPEC=2 rvm: 2.0.0 + - gemfile: gemfiles/2.8 + env: TARGET_RSPEC=2 + rvm: 2.0.0 - gemfile: gemfiles/2.10 env: TARGET_RSPEC=2 rvm: 2.0.0 @@ -32,6 +38,9 @@ matrix: - gemfile: gemfiles/2.6 env: TARGET_RSPEC=2 rvm: 2.1.0 + - gemfile: gemfiles/2.8 + env: TARGET_RSPEC=2 + rvm: 2.1.0 - gemfile: gemfiles/2.10 env: TARGET_RSPEC=2 rvm: 2.1.0 diff --git a/Gemfile.lock b/Gemfile.lock index 01fe804..f46ee3b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,43 +7,116 @@ PATH GEM remote: https://rubygems.org/ specs: - chunky_png (1.2.9) - compass (0.12.2) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.1) - corundum (0.3.5) + activesupport (4.1.5) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + addressable (2.3.6) + arrayfields (4.9.2) + awesome_print (1.2.0) + caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) + corundum (0.4.1) bundler - compass (>= 0.12.1) - mailfactory (~> 1.4.0) - mattock (~> 0.7.1) - nokogiri - rdoc + caliph (~> 0.3) + mattock (~> 0.9) + paint (~> 0.8.7) rspec (>= 2.0) simplecov (>= 0.5.4) - yard + simplecov-json (>= 0.2) diff-lcs (1.2.5) - docile (1.1.2) - fssm (0.2.10) + docile (1.1.5) + erubis (2.7.0) + fattr (2.2.2) + flay (2.5.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) fuubar (1.0.0) rspec (~> 2.0) rspec-instafail (~> 0.2.0) ruby-progressbar (~> 0.0.10) + hirb (0.7.2) + i18n (0.6.11) json (1.8.1) - mailfactory (1.4.0) - mime-types (>= 1.13.1) - mattock (0.7.1) + json_pure (1.8.1) + launchy (2.4.2) + addressable (~> 2.3) + main (6.0.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.4) + mattock (0.9.0) + caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - mime-types (2.1) - mini_portile (0.5.2) - multi_json (1.8.4) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) - rake (10.1.1) - rdoc (4.1.1) - json (~> 1.4) + metric_fu (4.11.1) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.3) + minitest (5.4.0) + multi_json (1.10.1) + netrc (0.7.7) + paint (0.8.7) + parallel (1.2.4) + rails_best_practices (1.15.4) + activesupport + awesome_print + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) + rake (10.3.2) + redcard (1.1.0) + reek (1.3.8) + rainbow (>= 1.99, < 3.0) + ruby2ruby (>= 2.0.8, < 3.0) + ruby_parser (~> 3.3) + sexp_processor + require_all (1.3.2) + rest-client (1.7.2) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) @@ -54,20 +127,31 @@ GEM rspec-instafail (0.2.4) rspec-mocks (2.14.4) ruby-progressbar (0.0.10) - sass (3.2.14) - simplecov (0.8.2) + ruby2ruby (2.1.1) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.6.2) + sexp_processor (~> 4.1) + sexp_processor (4.4.4) + simplecov (0.9.0) docile (~> 1.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) - tilt (1.4.1) + simplecov-json (0.2) + json + simplecov + thread_safe (0.3.4) + tilt (2.0.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) valise (1.1.1) - yard (0.8.7.3) PLATFORMS ruby DEPENDENCIES - corundum (>= 0.0.25) + corundum (>= 0.4.0) fuubar + metric_fu (~> 4.11.1) rspec-steps! From ae6772af0b288672136654234096376a6f04a93e Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 25 Aug 2014 15:49:19 -0700 Subject: [PATCH 077/127] Bundle updates to get coru-0.4.1 --- .gitignore | 1 + gemfiles/2.10.lock | 2 +- gemfiles/2.14.lock | 2 +- gemfiles/2.6.lock | 2 +- gemfiles/2.8.lock | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 82f9fda..0f36e89 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ corundum/ .sass-cache/ .yardoc/ gh-pages/ +tmp/ diff --git a/gemfiles/2.10.lock b/gemfiles/2.10.lock index c5fa4dc..18a9f67 100644 --- a/gemfiles/2.10.lock +++ b/gemfiles/2.10.lock @@ -33,7 +33,7 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.0) + corundum (0.4.1) bundler caliph (~> 0.3) mattock (~> 0.9) diff --git a/gemfiles/2.14.lock b/gemfiles/2.14.lock index 8c0d4bb..b76ae2e 100644 --- a/gemfiles/2.14.lock +++ b/gemfiles/2.14.lock @@ -33,7 +33,7 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.0) + corundum (0.4.1) bundler caliph (~> 0.3) mattock (~> 0.9) diff --git a/gemfiles/2.6.lock b/gemfiles/2.6.lock index f6d00ec..3c6e292 100644 --- a/gemfiles/2.6.lock +++ b/gemfiles/2.6.lock @@ -33,7 +33,7 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.0) + corundum (0.4.1) bundler caliph (~> 0.3) mattock (~> 0.9) diff --git a/gemfiles/2.8.lock b/gemfiles/2.8.lock index 4401e2b..eaeabc6 100644 --- a/gemfiles/2.8.lock +++ b/gemfiles/2.8.lock @@ -33,7 +33,7 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.0) + corundum (0.4.1) bundler caliph (~> 0.3) mattock (~> 0.9) From f92cd1a03771bb0fdd60facfe87d0d0f67487ed4 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 7 Nov 2014 23:35:12 -0800 Subject: [PATCH 078/127] Abandoning RSpec 2.x (but see two-step) --- rspec2.conf => .rspec | 1 + Gemfile-2.10 | 6 - Gemfile-2.7 | 6 - Gemfile-2.8 | 6 - Gemfile.lock | 34 +++--- Rakefile | 30 +++-- doc/README | 17 +-- gemfiles/2.10 | 6 - gemfiles/2.10.lock | 152 ------------------------ gemfiles/2.14 | 6 - gemfiles/2.6.lock | 152 ------------------------ gemfiles/2.8 | 6 - gemfiles/2.8.lock | 152 ------------------------ gemfiles/3.0.lock | 2 +- gemfiles/{2.6 => 3.1} | 3 +- gemfiles/{2.14.lock => 3.1.lock} | 54 +++++---- rspec-steps.gemspec | 14 +-- rspec3.conf | 6 - {spec3 => spec}/example_group_spec.rb | 0 spec2/example_group_spec.rb | 164 -------------------------- spec3_help/file-sandbox.rb | 164 -------------------------- spec3_help/gem_test_suite.rb | 17 --- spec3_help/rspec-sandbox.rb | 68 ----------- spec3_help/spec_helper.rb | 3 - spec3_help/ungemmer.rb | 36 ------ spec_help/file-sandbox.rb | 20 ++-- spec_help/rspec-sandbox.rb | 94 +++++++++------ 27 files changed, 149 insertions(+), 1070 deletions(-) rename rspec2.conf => .rspec (91%) delete mode 100644 Gemfile-2.10 delete mode 100644 Gemfile-2.7 delete mode 100644 Gemfile-2.8 delete mode 100644 gemfiles/2.10 delete mode 100644 gemfiles/2.10.lock delete mode 100644 gemfiles/2.14 delete mode 100644 gemfiles/2.6.lock delete mode 100644 gemfiles/2.8 delete mode 100644 gemfiles/2.8.lock rename gemfiles/{2.6 => 3.1} (68%) rename gemfiles/{2.14.lock => 3.1.lock} (79%) delete mode 100644 rspec3.conf rename {spec3 => spec}/example_group_spec.rb (100%) delete mode 100644 spec2/example_group_spec.rb delete mode 100644 spec3_help/file-sandbox.rb delete mode 100644 spec3_help/gem_test_suite.rb delete mode 100644 spec3_help/rspec-sandbox.rb delete mode 100644 spec3_help/spec_helper.rb delete mode 100644 spec3_help/ungemmer.rb diff --git a/rspec2.conf b/.rspec similarity index 91% rename from rspec2.conf rename to .rspec index 175ff48..86bb78c 100644 --- a/rspec2.conf +++ b/.rspec @@ -3,3 +3,4 @@ -I ./spec_help --require spec_helper --pattern *.rb +--color diff --git a/Gemfile-2.10 b/Gemfile-2.10 deleted file mode 100644 index eb236b4..0000000 --- a/Gemfile-2.10 +++ /dev/null @@ -1,6 +0,0 @@ -source "http://lrdesign:quiS6Nef@gems.lrdesign.com" -source "http://gemcutter.org" -source "http://gems.github.com" - -gem 'rspec', "~> 2.10.0" -gemspec diff --git a/Gemfile-2.7 b/Gemfile-2.7 deleted file mode 100644 index 03ab3b3..0000000 --- a/Gemfile-2.7 +++ /dev/null @@ -1,6 +0,0 @@ -source "http://lrdesign:quiS6Nef@gems.lrdesign.com" -source "http://gemcutter.org" -source "http://gems.github.com" - -gem 'rspec', "~> 2.7.0" -gemspec diff --git a/Gemfile-2.8 b/Gemfile-2.8 deleted file mode 100644 index 61ee5ac..0000000 --- a/Gemfile-2.8 +++ /dev/null @@ -1,6 +0,0 @@ -source "http://lrdesign:quiS6Nef@gems.lrdesign.com" -source "http://gemcutter.org" -source "http://gems.github.com" - -gem 'rspec', "~> 2.8.0" -gemspec diff --git a/Gemfile.lock b/Gemfile.lock index f46ee3b..5dc37d5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - rspec-steps (0.4.1) - rspec (>= 2.6, < 3.99) + rspec-steps (0.5.0) + rspec (>= 3.0, < 3.99) GEM remote: https://rubygems.org/ @@ -51,10 +51,9 @@ GEM flog (4.3.0) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.4) - fuubar (1.0.0) - rspec (~> 2.0) - rspec-instafail (~> 0.2.0) - ruby-progressbar (~> 0.0.10) + fuubar (2.0.0) + rspec (~> 3.0) + ruby-progressbar (~> 1.4) hirb (0.7.2) i18n (0.6.11) json (1.8.1) @@ -117,16 +116,19 @@ GEM netrc (~> 0.7) roodi (3.3.1) ruby_parser (~> 3.2, >= 3.2.2) - rspec (2.14.1) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) - rspec-core (2.14.7) - rspec-expectations (2.14.4) - diff-lcs (>= 1.1.3, < 2.0) - rspec-instafail (0.2.4) - rspec-mocks (2.14.4) - ruby-progressbar (0.0.10) + rspec (3.1.0) + rspec-core (~> 3.1.0) + rspec-expectations (~> 3.1.0) + rspec-mocks (~> 3.1.0) + rspec-core (3.1.7) + rspec-support (~> 3.1.0) + rspec-expectations (3.1.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.1.0) + rspec-mocks (3.1.3) + rspec-support (~> 3.1.0) + rspec-support (3.1.2) + ruby-progressbar (1.7.0) ruby2ruby (2.1.1) ruby_parser (~> 3.1) sexp_processor (~> 4.0) diff --git a/Rakefile b/Rakefile index 12e70a6..2627c8a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,11 @@ require 'corundum/tasklibs' -#require 'mattock/yard_extensions' module Corundum register_project(__FILE__) tk = Toolkit.new do |tk| tk.file_lists.project = [__FILE__] - tk.file_lists.test << FileList["spec2/**/*.rb"] - tk.file_lists.test << FileList["spec3/**/*.rb"] + tk.file_lists.test << FileList["spec/**/*.rb"] end tk.in_namespace do @@ -19,23 +17,29 @@ module Corundum end rspec = RSpec.new(tk) do |rspec| - if ENV["TARGET_RSPEC"]=="3" - rspec.rspec_opts << "-O rspec3.conf" - rspec.files_to_run = "spec3" - else - rspec.rspec_opts << "-O rspec2.conf" - rspec.files_to_run = "spec2" - end + rspec.files_to_run = "spec" end - cov = SimpleCov.new(tk, rspec) do |cov| + SimpleCov.new(tk, rspec) do |cov| cov.threshold = 75 end gem = GemBuilding.new(tk) - cutter = GemCutter.new(tk,gem) - vc = Git.new(tk) do |vc| + GemCutter.new(tk,gem) + Git.new(tk) do |vc| vc.branch = "master" end end end +Dir['gemfiles/*'].delete_if{|path| path =~ /lock\z/ }.each do |gemfile| + gemfile_lock = gemfile + ".lock" + file gemfile_lock => [gemfile, "rspec-steps.gemspec"] do + Bundler.with_clean_env do + sh "bundle install --gemfile #{gemfile}" + end + end + + desc "Update all the bundler lockfiles for Travis" + task :travis_gemfiles => gemfile_lock +end + task :default => [:release, :publish_docs] diff --git a/doc/README b/doc/README index 28a948f..47ef45a 100644 --- a/doc/README +++ b/doc/README @@ -6,6 +6,10 @@ in sequence and which stop when a step fails. It's often incredibly useful to be able to aseemble a series of tests that should all pass, but where completely isolating them is less than sensible. +( RSpec Steps has gone on with the tide of progress - it only supports RSpec +3.x. If you need Rspec 2 suport, check out two-step: +https://github.com/LRDesign/two-step ) + One excellent example is web site integration tests. With RSpec steps you can do: @@ -106,11 +110,10 @@ diverge, you can DRY your code out with shared_steps blocks, like so: ## Versions and Dependencies -0.1.0: Released Mar 12, 2013. - Compatible with RSpec 2.10-2.13 - probably works with earlier versions - -0.0.9: Released Feb 22, 2013. - NOTES: works with rspec 2.6 through 2.10. Does not work with rspec >= 2.11 +The goal (sadly unfulfilled) is to try to be compatible with as many versions +of RSpec 3.x as possible. Frankly, Rspec-Steps is more than a little bit of a +hack, and intrudes wholesale on RSpec's private interfaces. -0.0.8: Released Jan 11, 2012. - NOTES: Will not work with rspec > 2.9. +We make good use of Travis to check compatibility, however. You can check what +versions of RSpec and Ruby RSpec-Steps works with here: +https://travis-ci.org/LRDesign/rspec-steps diff --git a/gemfiles/2.10 b/gemfiles/2.10 deleted file mode 100644 index 2e2f8ff..0000000 --- a/gemfiles/2.10 +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gem "rspec", "~> 2.10.0" - - -gemspec :path => ".." diff --git a/gemfiles/2.10.lock b/gemfiles/2.10.lock deleted file mode 100644 index 18a9f67..0000000 --- a/gemfiles/2.10.lock +++ /dev/null @@ -1,152 +0,0 @@ -PATH - remote: .. - specs: - rspec-steps (0.4.1) - rspec (>= 2.6, < 3.99) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.1.4) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - addressable (2.3.6) - arrayfields (4.9.2) - awesome_print (1.2.0) - caliph (0.3.1) - cane (2.6.2) - parallel - chronic (0.10.2) - churn (0.0.35) - chronic (>= 0.2.3) - hirb - json_pure - main - rest-client (>= 1.6.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.1) - code_analyzer (0.4.5) - sexp_processor - code_metrics (0.1.3) - coderay (1.1.0) - colored (1.2) - corundum (0.4.1) - bundler - caliph (~> 0.3) - mattock (~> 0.9) - paint (~> 0.8.7) - rspec (>= 2.0) - simplecov (>= 0.5.4) - simplecov-json (>= 0.2) - diff-lcs (1.1.3) - docile (1.1.5) - erubis (2.7.0) - fattr (2.2.2) - flay (2.5.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) - flog (4.3.0) - ruby_parser (~> 3.1, > 3.1.0) - sexp_processor (~> 4.4) - hirb (0.7.2) - i18n (0.6.11) - json (1.8.1) - json_pure (1.8.1) - launchy (2.4.2) - addressable (~> 2.3) - main (6.0.0) - arrayfields (>= 4.7.4) - chronic (>= 0.6.2) - fattr (>= 2.2.0) - map (>= 5.1.0) - map (6.5.4) - mattock (0.9.0) - caliph (~> 0.3.1) - rake (~> 10.0) - tilt (> 0) - valise (~> 1.1.1) - metric_fu (4.11.1) - cane (~> 2.5, >= 2.5.2) - churn (~> 0.0.35) - code_metrics (~> 0.1) - coderay - flay (~> 2.1, >= 2.0.1) - flog (~> 4.1, >= 4.1.1) - launchy (~> 2.0) - metric_fu-Saikuro (~> 1.1, >= 1.1.3) - multi_json - rails_best_practices (~> 1.14, >= 1.14.3) - redcard - reek (~> 1.3, >= 1.3.4) - roodi (~> 3.1) - metric_fu-Saikuro (1.1.3) - mime-types (2.3) - minitest (5.4.0) - multi_json (1.10.1) - netrc (0.7.7) - paint (0.8.7) - parallel (1.1.2) - rails_best_practices (1.15.4) - activesupport - awesome_print - code_analyzer (>= 0.4.3) - colored - erubis - i18n - json - require_all - ruby-progressbar - rainbow (2.0.0) - rake (10.3.2) - redcard (1.1.0) - reek (1.3.8) - rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor - require_all (1.3.2) - rest-client (1.7.2) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - roodi (3.3.1) - ruby_parser (~> 3.2, >= 3.2.2) - rspec (2.10.0) - rspec-core (~> 2.10.0) - rspec-expectations (~> 2.10.0) - rspec-mocks (~> 2.10.0) - rspec-core (2.10.1) - rspec-expectations (2.10.0) - diff-lcs (~> 1.1.3) - rspec-mocks (2.10.1) - ruby-progressbar (1.5.1) - ruby2ruby (2.1.1) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.6.2) - sexp_processor (~> 4.1) - sexp_processor (4.4.3) - simplecov (0.9.0) - docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) - simplecov-json (0.2) - json - simplecov - thread_safe (0.3.4) - tilt (2.0.1) - tzinfo (1.2.1) - thread_safe (~> 0.1) - valise (1.1.1) - -PLATFORMS - ruby - -DEPENDENCIES - corundum (>= 0.4.0) - metric_fu (~> 4.11.1) - rspec (~> 2.10.0) - rspec-steps! diff --git a/gemfiles/2.14 b/gemfiles/2.14 deleted file mode 100644 index 8f1c81e..0000000 --- a/gemfiles/2.14 +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gem "rspec", "~> 2.14.0" - - -gemspec :path => ".." diff --git a/gemfiles/2.6.lock b/gemfiles/2.6.lock deleted file mode 100644 index 3c6e292..0000000 --- a/gemfiles/2.6.lock +++ /dev/null @@ -1,152 +0,0 @@ -PATH - remote: .. - specs: - rspec-steps (0.4.1) - rspec (>= 2.6, < 3.99) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.1.4) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - addressable (2.3.6) - arrayfields (4.9.2) - awesome_print (1.2.0) - caliph (0.3.1) - cane (2.6.2) - parallel - chronic (0.10.2) - churn (0.0.35) - chronic (>= 0.2.3) - hirb - json_pure - main - rest-client (>= 1.6.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.1) - code_analyzer (0.4.5) - sexp_processor - code_metrics (0.1.3) - coderay (1.1.0) - colored (1.2) - corundum (0.4.1) - bundler - caliph (~> 0.3) - mattock (~> 0.9) - paint (~> 0.8.7) - rspec (>= 2.0) - simplecov (>= 0.5.4) - simplecov-json (>= 0.2) - diff-lcs (1.1.3) - docile (1.1.5) - erubis (2.7.0) - fattr (2.2.2) - flay (2.5.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) - flog (4.3.0) - ruby_parser (~> 3.1, > 3.1.0) - sexp_processor (~> 4.4) - hirb (0.7.2) - i18n (0.6.11) - json (1.8.1) - json_pure (1.8.1) - launchy (2.4.2) - addressable (~> 2.3) - main (6.0.0) - arrayfields (>= 4.7.4) - chronic (>= 0.6.2) - fattr (>= 2.2.0) - map (>= 5.1.0) - map (6.5.4) - mattock (0.9.0) - caliph (~> 0.3.1) - rake (~> 10.0) - tilt (> 0) - valise (~> 1.1.1) - metric_fu (4.11.1) - cane (~> 2.5, >= 2.5.2) - churn (~> 0.0.35) - code_metrics (~> 0.1) - coderay - flay (~> 2.1, >= 2.0.1) - flog (~> 4.1, >= 4.1.1) - launchy (~> 2.0) - metric_fu-Saikuro (~> 1.1, >= 1.1.3) - multi_json - rails_best_practices (~> 1.14, >= 1.14.3) - redcard - reek (~> 1.3, >= 1.3.4) - roodi (~> 3.1) - metric_fu-Saikuro (1.1.3) - mime-types (2.3) - minitest (5.4.0) - multi_json (1.10.1) - netrc (0.7.7) - paint (0.8.7) - parallel (1.1.2) - rails_best_practices (1.15.4) - activesupport - awesome_print - code_analyzer (>= 0.4.3) - colored - erubis - i18n - json - require_all - ruby-progressbar - rainbow (2.0.0) - rake (10.3.2) - redcard (1.1.0) - reek (1.3.8) - rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor - require_all (1.3.2) - rest-client (1.7.2) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - roodi (3.3.1) - ruby_parser (~> 3.2, >= 3.2.2) - rspec (2.6.0) - rspec-core (~> 2.6.0) - rspec-expectations (~> 2.6.0) - rspec-mocks (~> 2.6.0) - rspec-core (2.6.4) - rspec-expectations (2.6.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.6.0) - ruby-progressbar (1.5.1) - ruby2ruby (2.1.1) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.6.2) - sexp_processor (~> 4.1) - sexp_processor (4.4.3) - simplecov (0.9.0) - docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) - simplecov-json (0.2) - json - simplecov - thread_safe (0.3.4) - tilt (2.0.1) - tzinfo (1.2.1) - thread_safe (~> 0.1) - valise (1.1.1) - -PLATFORMS - ruby - -DEPENDENCIES - corundum (>= 0.4.0) - metric_fu (~> 4.11.1) - rspec (~> 2.6.0) - rspec-steps! diff --git a/gemfiles/2.8 b/gemfiles/2.8 deleted file mode 100644 index 71e8b6f..0000000 --- a/gemfiles/2.8 +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gem "rspec", "~> 2.8.0" - - -gemspec :path => ".." diff --git a/gemfiles/2.8.lock b/gemfiles/2.8.lock deleted file mode 100644 index eaeabc6..0000000 --- a/gemfiles/2.8.lock +++ /dev/null @@ -1,152 +0,0 @@ -PATH - remote: .. - specs: - rspec-steps (0.4.1) - rspec (>= 2.6, < 3.99) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.1.4) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - addressable (2.3.6) - arrayfields (4.9.2) - awesome_print (1.2.0) - caliph (0.3.1) - cane (2.6.2) - parallel - chronic (0.10.2) - churn (0.0.35) - chronic (>= 0.2.3) - hirb - json_pure - main - rest-client (>= 1.6.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.1) - code_analyzer (0.4.5) - sexp_processor - code_metrics (0.1.3) - coderay (1.1.0) - colored (1.2) - corundum (0.4.1) - bundler - caliph (~> 0.3) - mattock (~> 0.9) - paint (~> 0.8.7) - rspec (>= 2.0) - simplecov (>= 0.5.4) - simplecov-json (>= 0.2) - diff-lcs (1.1.3) - docile (1.1.5) - erubis (2.7.0) - fattr (2.2.2) - flay (2.5.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) - flog (4.3.0) - ruby_parser (~> 3.1, > 3.1.0) - sexp_processor (~> 4.4) - hirb (0.7.2) - i18n (0.6.11) - json (1.8.1) - json_pure (1.8.1) - launchy (2.4.2) - addressable (~> 2.3) - main (6.0.0) - arrayfields (>= 4.7.4) - chronic (>= 0.6.2) - fattr (>= 2.2.0) - map (>= 5.1.0) - map (6.5.4) - mattock (0.9.0) - caliph (~> 0.3.1) - rake (~> 10.0) - tilt (> 0) - valise (~> 1.1.1) - metric_fu (4.11.1) - cane (~> 2.5, >= 2.5.2) - churn (~> 0.0.35) - code_metrics (~> 0.1) - coderay - flay (~> 2.1, >= 2.0.1) - flog (~> 4.1, >= 4.1.1) - launchy (~> 2.0) - metric_fu-Saikuro (~> 1.1, >= 1.1.3) - multi_json - rails_best_practices (~> 1.14, >= 1.14.3) - redcard - reek (~> 1.3, >= 1.3.4) - roodi (~> 3.1) - metric_fu-Saikuro (1.1.3) - mime-types (2.3) - minitest (5.4.0) - multi_json (1.10.1) - netrc (0.7.7) - paint (0.8.7) - parallel (1.1.2) - rails_best_practices (1.15.4) - activesupport - awesome_print - code_analyzer (>= 0.4.3) - colored - erubis - i18n - json - require_all - ruby-progressbar - rainbow (2.0.0) - rake (10.3.2) - redcard (1.1.0) - reek (1.3.8) - rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor - require_all (1.3.2) - rest-client (1.7.2) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - roodi (3.3.1) - ruby_parser (~> 3.2, >= 3.2.2) - rspec (2.8.0) - rspec-core (~> 2.8.0) - rspec-expectations (~> 2.8.0) - rspec-mocks (~> 2.8.0) - rspec-core (2.8.0) - rspec-expectations (2.8.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.8.0) - ruby-progressbar (1.5.1) - ruby2ruby (2.1.1) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.6.2) - sexp_processor (~> 4.1) - sexp_processor (4.4.3) - simplecov (0.9.0) - docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) - simplecov-json (0.2) - json - simplecov - thread_safe (0.3.4) - tilt (2.0.1) - tzinfo (1.2.1) - thread_safe (~> 0.1) - valise (1.1.1) - -PLATFORMS - ruby - -DEPENDENCIES - corundum (>= 0.4.0) - metric_fu (~> 4.11.1) - rspec (~> 2.8.0) - rspec-steps! diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 6369fd6..60a2081 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (0.4.1) + rspec-steps (0.5.0) rspec (>= 2.6, < 3.99) GEM diff --git a/gemfiles/2.6 b/gemfiles/3.1 similarity index 68% rename from gemfiles/2.6 rename to gemfiles/3.1 index 4aac5b8..70eabd7 100644 --- a/gemfiles/2.6 +++ b/gemfiles/3.1 @@ -1,6 +1,5 @@ source "https://rubygems.org" -gem "rspec", "~> 2.6.0" - +gem "rspec", "~> 3.1.0" gemspec :path => ".." diff --git a/gemfiles/2.14.lock b/gemfiles/3.1.lock similarity index 79% rename from gemfiles/2.14.lock rename to gemfiles/3.1.lock index b76ae2e..e91157d 100644 --- a/gemfiles/2.14.lock +++ b/gemfiles/3.1.lock @@ -1,13 +1,13 @@ PATH remote: .. specs: - rspec-steps (0.4.1) + rspec-steps (0.5.0) rspec (>= 2.6, < 3.99) GEM remote: https://rubygems.org/ specs: - activesupport (4.1.4) + activesupport (4.1.7) i18n (~> 0.6, >= 0.6.9) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -55,14 +55,14 @@ GEM i18n (0.6.11) json (1.8.1) json_pure (1.8.1) - launchy (2.4.2) + launchy (2.4.3) addressable (~> 2.3) - main (6.0.0) + main (6.1.0) arrayfields (>= 4.7.4) chronic (>= 0.6.2) fattr (>= 2.2.0) map (>= 5.1.0) - map (6.5.4) + map (6.5.5) mattock (0.9.0) caliph (~> 0.3.1) rake (~> 10.0) @@ -83,12 +83,12 @@ GEM reek (~> 1.3, >= 1.3.4) roodi (~> 3.1) metric_fu-Saikuro (1.1.3) - mime-types (2.3) - minitest (5.4.0) + mime-types (2.4.3) + minitest (5.4.2) multi_json (1.10.1) - netrc (0.7.7) + netrc (0.8.0) paint (0.8.7) - parallel (1.1.2) + parallel (1.3.3) rails_best_practices (1.15.4) activesupport awesome_print @@ -113,24 +113,28 @@ GEM netrc (~> 0.7) roodi (3.3.1) ruby_parser (~> 3.2, >= 3.2.2) - rspec (2.14.1) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) - rspec-core (2.14.8) - rspec-expectations (2.14.5) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.6) - ruby-progressbar (1.5.1) - ruby2ruby (2.1.1) + rspec (3.1.0) + rspec-core (~> 3.1.0) + rspec-expectations (~> 3.1.0) + rspec-mocks (~> 3.1.0) + rspec-core (3.1.7) + rspec-support (~> 3.1.0) + rspec-expectations (3.1.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.1.0) + rspec-mocks (3.1.3) + rspec-support (~> 3.1.0) + rspec-support (3.1.2) + ruby-progressbar (1.7.0) + ruby2ruby (2.1.3) ruby_parser (~> 3.1) sexp_processor (~> 4.0) - ruby_parser (3.6.2) + ruby_parser (3.6.3) sexp_processor (~> 4.1) - sexp_processor (4.4.3) - simplecov (0.9.0) + sexp_processor (4.4.4) + simplecov (0.9.1) docile (~> 1.1.0) - multi_json + multi_json (~> 1.0) simplecov-html (~> 0.8.0) simplecov-html (0.8.0) simplecov-json (0.2) @@ -138,7 +142,7 @@ GEM simplecov thread_safe (0.3.4) tilt (2.0.1) - tzinfo (1.2.1) + tzinfo (1.2.2) thread_safe (~> 0.1) valise (1.1.1) @@ -148,5 +152,5 @@ PLATFORMS DEPENDENCIES corundum (>= 0.4.0) metric_fu (~> 4.11.1) - rspec (~> 2.14.0) + rspec (~> 3.1.0) rspec-steps! diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index ffa4c1a..0b190cd 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.4.1" + spec.version = "0.5.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" @@ -29,21 +29,15 @@ Gem::Specification.new do |spec| lib/rspec-steps/duckpunch/object-extensions.rb doc/README doc/Specifications - spec2/example_group_spec.rb - spec3/example_group_spec.rb + spec/example_group_spec.rb spec_help/spec_helper.rb spec_help/gem_test_suite.rb spec_help/rspec-sandbox.rb spec_help/ungemmer.rb spec_help/file-sandbox.rb - spec3_help/spec_helper.rb - spec3_help/gem_test_suite.rb - spec3_help/rspec-sandbox.rb - spec3_help/ungemmer.rb - spec3_help/file-sandbox.rb ] - spec.test_file = "spec3_help/gem_test_suite.rb" + spec.test_file = "spec_help/gem_test_suite.rb" spec.licenses = ["MIT"] spec.require_paths = %w[lib/] spec.rubygems_version = "1.3.5" @@ -77,7 +71,7 @@ Gem::Specification.new do |spec| spec.rdoc_options += %w{--main doc/README } spec.rdoc_options += ["--title", "#{spec.name}-#{spec.version} RDoc"] - spec.add_dependency("rspec", ">= 2.6", "< 3.99") + spec.add_dependency("rspec", ">= 3.0", "< 3.99") spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" end diff --git a/rspec3.conf b/rspec3.conf deleted file mode 100644 index a525713..0000000 --- a/rspec3.conf +++ /dev/null @@ -1,6 +0,0 @@ --I ./spec3_help/interpose --I ./lib --I ./spec3_help ---require spec_helper ---pattern *.rb ---color diff --git a/spec3/example_group_spec.rb b/spec/example_group_spec.rb similarity index 100% rename from spec3/example_group_spec.rb rename to spec/example_group_spec.rb diff --git a/spec2/example_group_spec.rb b/spec2/example_group_spec.rb deleted file mode 100644 index 901cc05..0000000 --- a/spec2/example_group_spec.rb +++ /dev/null @@ -1,164 +0,0 @@ -require 'rspec-steps' -require 'rspec-sandbox' - -describe RSpec::Core::ExampleGroup do - describe "::steps" do - it "should create an ExampleGroup that includes RSpec::Stepwise" do - group = nil - sandboxed do - group = RSpec.steps "Test Steps" do - end - end - (class << group; self; end).included_modules.should include(RSpecStepwise::ClassMethods) - end - end - - describe "with Stepwise included" do - it "should retain instance variables between steps" do - group = nil - sandboxed do - group = RSpec.steps "Test Steps" do - it("sets @a"){ @a = 1 } - it("reads @a"){ @a.should == 1} - end - group.run - end - - group.examples.each do |example| - example.metadata[:execution_result][:status].should == 'passed' - end - end - - it "should work with shared_steps/perform steps" do - group = nil - sandboxed do - group = RSpec.steps "Test Steps" do - shared_steps "add one" do - it("adds one to @a"){ @a += 1 } - end - it("sets @a"){ @a = 1 } - perform_steps "add one" - perform_steps "add one" - perform_steps "add one" - it("reads @a"){ @a.should == 4 } - end - group.run - end - - group.examples.each do |example| - example.metadata[:execution_result][:status].should == 'passed' - end - end - - it "should run each_step hooks" do - group = nil - afters = [] - befores = [] - - sandboxed do - group = RSpec.steps "Test Each Step" do - before :each do - befores << :each - end - after :each do - afters << :each - end - - before :all do - befores << :all - end - after :all do - afters << :all - end - - before :step do - befores << :step - end - after :step do - afters << :step - end - - it "should 1" do - 1.should == 1 - end - it "should 2" do - 2.should == 2 - end - it "should 3" do - 3.should == 3 - end - end - group.run - end - - befores.find_all{|item| item == :all}.length.should == 1 - befores.find_all{|item| item == :each}.length.should == 1 - befores.find_all{|item| item == :step}.length.should == 3 - afters.find_all{|item| item == :all}.length.should == 1 - afters.find_all{|item| item == :each}.length.should == 1 - afters.find_all{|item| item == :step}.length.should == 3 - end - - it "should mark later examples as failed if a before hook fails" do - group = nil - exception = Exception.new "Testing Error" - - sandboxed do - group = RSpec.steps "Test Steps" do - before { raise exception } - it { 1.should == 1 } - it { 1.should == 1 } - end - group.run - end - - group.examples.each do |example| - example.metadata[:execution_result][:status].should == 'failed' - example.metadata[:execution_result][:exception].should == exception - end - end - - it "should mark later examples as pending if one fails" do - group = nil - sandboxed do - group = RSpec.steps "Test Steps" do - it { fail "All others fail" } - it { 1.should == 1 } - end - group.run - end - - group.examples[1].metadata[:pending].should == true - end - - it "should allow nested steps", :pending => "Not really" do - group = nil - sandboxed do - group = RSpec.steps "Test Steps" do - steps "Nested" do - it { @a = 1 } - it { @a.should == 1} - end - end - group.run - end - - group.children[0].examples.each do |example| - example.metadata[:execution_result][:status].should == 'passed' - end - group.children[0].should have(2).examples - end - - it "should not allow nested normal contexts" do - pending "A correct approach - in the meantime, this behavior is undefined" - expect { - sandboxed do - RSpec.steps "Basic" do - describe "Not allowed" do - end - end - end - }.to raise_error - end - end -end diff --git a/spec3_help/file-sandbox.rb b/spec3_help/file-sandbox.rb deleted file mode 100644 index 3d9e326..0000000 --- a/spec3_help/file-sandbox.rb +++ /dev/null @@ -1,164 +0,0 @@ -require 'ftools' -require 'fileutils' - -module FileSandbox - def self.included(spec) - return unless spec.respond_to? :before - - spec.before do - setup_sandbox - end - - spec.after do - teardown_sandbox - end - end - - class HaveContents - def initialize(contents) - @contents = contents - end - - def matches?(target) - case @contents - when Regexp - @contents =~ target.contents - when String - @contents == target.contents - end - end - end - - def have_contents(expected) - HaveContents.new(expected) - end - - attr_reader :sandbox - - def in_sandbox(&block) - raise "I expected to create a sandbox as you passed in a block to me" if !block_given? - - setup_sandbox - original_error = nil - - begin - yield @sandbox - rescue => e - original_error = e - raise - ensure - begin - teardown_sandbox - rescue - if original_error - STDERR.puts "ALERT: a test raised an error and failed to release some lock(s) in the sandbox directory" - raise(original_error) - else - raise - end - end - end - end - - def setup_sandbox(path = '__sandbox') - unless @sandbox - @sandbox = Sandbox.new(path) - @__old_path_for_sandbox = Dir.pwd - Dir.chdir(@sandbox.root) - end - end - - def teardown_sandbox - if @sandbox - Dir.chdir(@__old_path_for_sandbox) - @sandbox.clean_up - @sandbox = nil - end - end - - class Sandbox - attr_reader :root - - def initialize(path = '__sandbox') - @root = File.expand_path(path) - clean_up - FileUtils.mkdir_p @root - end - - def [](name) - SandboxFile.new(File.join(@root, name), name) - end - - # usage new :file=>'my file.rb', :with_contents=>'some stuff' - def new(options) - if options.has_key? :directory - dir = self[options.delete(:directory)] - FileUtils.mkdir_p dir.path - else - file = self[options.delete(:file)] - if (binary_content = options.delete(:with_binary_content) || options.delete(:with_binary_contents)) - file.binary_content = binary_content - else - file.content = (options.delete(:with_content) || options.delete(:with_contents) || '') - end - end - - raise "unexpected keys '#{options.keys.join(', ')}'" unless options.empty? - - dir || file - end - - def remove(options) - name = File.join(@root, options[:file]) - FileUtils.remove_file name - end - - def clean_up - FileUtils.rm_rf @root - if File.exists? @root - raise "Could not remove directory #{@root.inspect}, something is probably still holding a lock on it" - end - end - end - - - class SandboxFile - attr_reader :path - - def initialize(path, sandbox_path) - @path = path - @sandbox_path = sandbox_path - end - - def inspect - "SandboxFile: #@sandbox_path" - end - - def exist? - File.exist? path - end - - def content - File.read path - end - - def content=(content) - FileUtils.mkdir_p File.dirname(@path) - File.open(@path, "w") {|f| f << content} - end - - def binary_content=(content) - FileUtils.mkdir_p File.dirname(@path) - File.open(@path, "wb") {|f| f << content} - end - - def create - self.content = '' - end - - alias exists? exist? - alias contents content - alias contents= content= - alias binary_contents= binary_content= - end -end diff --git a/spec3_help/gem_test_suite.rb b/spec3_help/gem_test_suite.rb deleted file mode 100644 index d939b82..0000000 --- a/spec3_help/gem_test_suite.rb +++ /dev/null @@ -1,17 +0,0 @@ -puts Dir::pwd -require 'test/unit' -begin - require 'spec' -rescue LoadError - false -end - -class RSpecTest < Test::Unit::TestCase - def test_that_rspec_is_available - assert_nothing_raised("\n\n * RSpec isn't available - please run: gem install rspec *\n\n"){ ::Spec } - end - - def test_that_specs_pass - assert(system(*%w{spec -f e -p **/*.rb spec}),"\n\n * Specs failed *\n\n") - end -end diff --git a/spec3_help/rspec-sandbox.rb b/spec3_help/rspec-sandbox.rb deleted file mode 100644 index fce3dbf..0000000 --- a/spec3_help/rspec-sandbox.rb +++ /dev/null @@ -1,68 +0,0 @@ -require 'rspec/support/spec' -require 'rspec/core' - -class << RSpec - attr_writer :configuration, :world -end - -$rspec_core_without_stderr_monkey_patch = RSpec::Core::Configuration.new - -class RSpec::Core::Configuration - def self.new(*args, &block) - super.tap do |config| - # We detect ruby warnings via $stderr, - # so direct our deprecations to $stdout instead. - config.deprecation_stream = $stdout - end - end -end - -module Sandboxing - def sandboxed(&block) - @orig_config = RSpec.configuration - @orig_world = RSpec.world - @orig_example = RSpec.current_example - new_config = RSpec::Core::Configuration.new - new_config.expose_dsl_globally = false - new_config.expecting_with_rspec = true - new_config.include(RSpecStepwise, :stepwise => true) - new_world = RSpec::Core::World.new(new_config) - RSpec.configuration = new_config - RSpec.world = new_world - object = Object.new - object.extend(RSpec::Core::SharedExampleGroup) - - (class << RSpec::Core::ExampleGroup; self; end).class_exec do - alias_method :orig_run, :run - def run(reporter=nil) - RSpec.current_example = nil - orig_run(reporter || NullObject.new) - end - end - - RSpec::Mocks.with_temporary_scope do - object.instance_exec(&block) - end - ensure - (class << RSpec::Core::ExampleGroup; self; end).class_exec do - remove_method :run - alias_method :run, :orig_run - remove_method :orig_run - end - - RSpec.configuration = @orig_config - RSpec.world = @orig_world - RSpec.current_example = @orig_example - end -end - -RSpec.configure do |config| - config.include Sandboxing -end - -class NullObject - private - def method_missing(method, *args, &block) - # ignore - end -end diff --git a/spec3_help/spec_helper.rb b/spec3_help/spec_helper.rb deleted file mode 100644 index 88cb728..0000000 --- a/spec3_help/spec_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'rspec' - -#Ungemmer::ungem_gemspec diff --git a/spec3_help/ungemmer.rb b/spec3_help/ungemmer.rb deleted file mode 100644 index 91db63a..0000000 --- a/spec3_help/ungemmer.rb +++ /dev/null @@ -1,36 +0,0 @@ -class Ungemmer - def self.ungem(*names) - deps = names.map do |name| - Gem::Dependency.new(name, nil) - end - - deps.each do |dep| - Gem.source_index.search(dep).each do |gemspec| - puts " ** Ungemming #{gemspec.full_name} **" - Gem.source_index.remove_spec(gemspec.full_name) - end - end - - Gem.instance_eval do - if defined? Gem::MUTEX - Gem::MUTEX.synchronize do - @searcher = nil - end - else - @searcher = nil - end - end - end - - def self.ungem_gemspec - Dir[File::expand_path(__FILE__ + "../../../*.gemspec")].each do |gemspec_path| - puts "Ungemming based on #{gemspec_path}" - begin - spec = Gem::Specification::load(gemspec_path) - Ungemmer::ungem(spec) - rescue LoadError - puts "Couldn't load #{gemspec_path}" - end - end - end -end diff --git a/spec_help/file-sandbox.rb b/spec_help/file-sandbox.rb index 468e26d..3d9e326 100644 --- a/spec_help/file-sandbox.rb +++ b/spec_help/file-sandbox.rb @@ -34,7 +34,7 @@ def have_contents(expected) end attr_reader :sandbox - + def in_sandbox(&block) raise "I expected to create a sandbox as you passed in a block to me" if !block_given? @@ -84,7 +84,7 @@ def initialize(path = '__sandbox') clean_up FileUtils.mkdir_p @root end - + def [](name) SandboxFile.new(File.join(@root, name), name) end @@ -102,17 +102,17 @@ def new(options) file.content = (options.delete(:with_content) || options.delete(:with_contents) || '') end end - + raise "unexpected keys '#{options.keys.join(', ')}'" unless options.empty? - + dir || file end - + def remove(options) name = File.join(@root, options[:file]) FileUtils.remove_file name end - + def clean_up FileUtils.rm_rf @root if File.exists? @root @@ -124,7 +124,7 @@ def clean_up class SandboxFile attr_reader :path - + def initialize(path, sandbox_path) @path = path @sandbox_path = sandbox_path @@ -141,12 +141,12 @@ def exist? def content File.read path end - + def content=(content) FileUtils.mkdir_p File.dirname(@path) File.open(@path, "w") {|f| f << content} end - + def binary_content=(content) FileUtils.mkdir_p File.dirname(@path) File.open(@path, "wb") {|f| f << content} @@ -159,6 +159,6 @@ def create alias exists? exist? alias contents content alias contents= content= - alias binary_contents= binary_content= + alias binary_contents= binary_content= end end diff --git a/spec_help/rspec-sandbox.rb b/spec_help/rspec-sandbox.rb index 954a0ef..fce3dbf 100644 --- a/spec_help/rspec-sandbox.rb +++ b/spec_help/rspec-sandbox.rb @@ -1,46 +1,68 @@ +require 'rspec/support/spec' require 'rspec/core' -class NullObject - private - def method_missing(method, *args, &block) - # ignore - end +class << RSpec + attr_writer :configuration, :world end -def sandboxed(&block) - @orig_config = RSpec.configuration - @orig_world = RSpec.world - new_config = RSpec::Core::Configuration.new - new_world = RSpec::Core::World.new(new_config) - RSpec.instance_variable_set(:@configuration, new_config) - RSpec.instance_variable_set(:@world, new_world) - - load 'rspec-steps/duckpunch/example-group.rb' - - object = Object.new - object.extend(RSpec::Core::SharedExampleGroup) - object.extend(RSpec::Steps::DSL) - object.extend(RSpec::Core::DSL) - - (class << RSpec::Core::ExampleGroup; self; end).class_eval do - alias_method :orig_run, :run - def run(reporter=nil) - @orig_mock_space = RSpec::Mocks::space - RSpec::Mocks::space = RSpec::Mocks::Space.new - orig_run(reporter || NullObject.new) - ensure - RSpec::Mocks::space = @orig_mock_space +$rspec_core_without_stderr_monkey_patch = RSpec::Core::Configuration.new + +class RSpec::Core::Configuration + def self.new(*args, &block) + super.tap do |config| + # We detect ruby warnings via $stderr, + # so direct our deprecations to $stdout instead. + config.deprecation_stream = $stdout end end +end + +module Sandboxing + def sandboxed(&block) + @orig_config = RSpec.configuration + @orig_world = RSpec.world + @orig_example = RSpec.current_example + new_config = RSpec::Core::Configuration.new + new_config.expose_dsl_globally = false + new_config.expecting_with_rspec = true + new_config.include(RSpecStepwise, :stepwise => true) + new_world = RSpec::Core::World.new(new_config) + RSpec.configuration = new_config + RSpec.world = new_world + object = Object.new + object.extend(RSpec::Core::SharedExampleGroup) - object.instance_eval(&block) -ensure - (class << RSpec::Core::ExampleGroup; self; end).class_eval do - remove_method :run - alias_method :run, :orig_run - remove_method :orig_run + (class << RSpec::Core::ExampleGroup; self; end).class_exec do + alias_method :orig_run, :run + def run(reporter=nil) + RSpec.current_example = nil + orig_run(reporter || NullObject.new) + end + end + + RSpec::Mocks.with_temporary_scope do + object.instance_exec(&block) + end + ensure + (class << RSpec::Core::ExampleGroup; self; end).class_exec do + remove_method :run + alias_method :run, :orig_run + remove_method :orig_run + end + + RSpec.configuration = @orig_config + RSpec.world = @orig_world + RSpec.current_example = @orig_example end +end + +RSpec.configure do |config| + config.include Sandboxing +end - RSpec.instance_variable_set(:@configuration, @orig_config) - RSpec.instance_variable_set(:@world, @orig_world) +class NullObject + private + def method_missing(method, *args, &block) + # ignore + end end From 78016782bb634d5986cf69dd67bdbf94a3470851 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 7 Nov 2014 23:36:51 -0800 Subject: [PATCH 079/127] Removing 2.x from build matrix --- .travis.yml | 49 +++++++++---------------------------------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 783e5d2..0e43172 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,53 +3,22 @@ script: bundle exec rake ci install: .travis-support/cached-bundle install --deployment matrix: include: - - gemfile: gemfiles/2.6 - env: TARGET_RSPEC=2 - rvm: 1.9.3 - - gemfile: gemfiles/2.8 - env: TARGET_RSPEC=2 - rvm: 1.9.3 - - gemfile: gemfiles/2.10 - env: TARGET_RSPEC=2 - rvm: 1.9.3 - - gemfile: gemfiles/2.14 - env: TARGET_RSPEC=2 - rvm: 1.9.3 - gemfile: gemfiles/3.0 - env: TARGET_RSPEC=3 + rvm: 1.9.3 + - gemfile: gemfiles/3.1 rvm: 1.9.3 - - gemfile: gemfiles/2.6 - env: TARGET_RSPEC=2 - rvm: 2.0.0 - - gemfile: gemfiles/2.8 - env: TARGET_RSPEC=2 - rvm: 2.0.0 - - gemfile: gemfiles/2.10 - env: TARGET_RSPEC=2 - rvm: 2.0.0 - - gemfile: gemfiles/2.14 - env: TARGET_RSPEC=2 - rvm: 2.0.0 + - gemfile: gemfiles/3.0 - env: TARGET_RSPEC=3 rvm: 2.0.0 + - gemfile: gemfiles/3.1 + rvm: 2.0.0 + - - gemfile: gemfiles/2.6 - env: TARGET_RSPEC=2 - rvm: 2.1.0 - - gemfile: gemfiles/2.8 - env: TARGET_RSPEC=2 - rvm: 2.1.0 - - gemfile: gemfiles/2.10 - env: TARGET_RSPEC=2 - rvm: 2.1.0 - - gemfile: gemfiles/2.14 - env: TARGET_RSPEC=2 - rvm: 2.1.0 - gemfile: gemfiles/3.0 - env: TARGET_RSPEC=3 - rvm: 2.1.0 + rvm: 2.1.2 + - gemfile: gemfiles/3.1 + rvm: 2.1.2 env: global: - CUSTOM_BUNDLE_PATH=gemfiles/vendor/bundle AMAZON_S3_BUCKET=lrd-travis-caching From 84445cb007d982070a9668db2cd00567f4a09de4 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 7 Nov 2014 23:42:39 -0800 Subject: [PATCH 080/127] Version 1.0 --- rspec-steps.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 0b190cd..5bfe87e 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "0.5.0" + spec.version = "1.0.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 043792aee813d42d64e015a379a0ba6e4dc50d47 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 7 Nov 2014 23:43:39 -0800 Subject: [PATCH 081/127] Bundler --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5dc37d5..5add583 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (0.5.0) + rspec-steps (1.0.0) rspec (>= 3.0, < 3.99) GEM From d51761534ca24c59da42f413173f31f50c293fb3 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:06:41 -0800 Subject: [PATCH 082/127] Adding :step context --- lib/rspec-steps.rb | 1 + lib/rspec-steps/duckpunch/hooks.rb | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 lib/rspec-steps/duckpunch/hooks.rb diff --git a/lib/rspec-steps.rb b/lib/rspec-steps.rb index e2af37e..838aa3b 100644 --- a/lib/rspec-steps.rb +++ b/lib/rspec-steps.rb @@ -1,3 +1,4 @@ require 'rspec-steps/duckpunch/object-extensions' require 'rspec-steps/duckpunch/example-group' require 'rspec-steps/duckpunch/example' +require 'rspec-steps/duckpunch/hooks' diff --git a/lib/rspec-steps/duckpunch/hooks.rb b/lib/rspec-steps/duckpunch/hooks.rb new file mode 100644 index 0000000..9ba5fe7 --- /dev/null +++ b/lib/rspec-steps/duckpunch/hooks.rb @@ -0,0 +1,5 @@ +require 'rspec/core/hooks' + +module RSpec::Core::Hooks + SCOPES << :step +end From 56fcc2d98bfb44552e2c92973dca514c77f77640 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:08:30 -0800 Subject: [PATCH 083/127] Update Travis gemfiles --- gemfiles/3.0.lock | 4 ++-- gemfiles/3.1.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 60a2081..694ebcf 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,8 +1,8 @@ PATH remote: .. specs: - rspec-steps (0.5.0) - rspec (>= 2.6, < 3.99) + rspec-steps (1.0.0) + rspec (>= 3.0, < 3.99) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index e91157d..1abed6f 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,8 +1,8 @@ PATH remote: .. specs: - rspec-steps (0.5.0) - rspec (>= 2.6, < 3.99) + rspec-steps (1.0.0) + rspec (>= 3.0, < 3.99) GEM remote: https://rubygems.org/ From cfe3f4a5bdaa1666ecfd2e700978e81687f02a5f Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:12:07 -0800 Subject: [PATCH 084/127] HookCollections :| --- lib/rspec-steps/duckpunch/hooks.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rspec-steps/duckpunch/hooks.rb b/lib/rspec-steps/duckpunch/hooks.rb index 9ba5fe7..dca4107 100644 --- a/lib/rspec-steps/duckpunch/hooks.rb +++ b/lib/rspec-steps/duckpunch/hooks.rb @@ -1,5 +1,7 @@ require 'rspec/core/hooks' module RSpec::Core::Hooks - SCOPES << :step + class HookCollections + SCOPES << :step + end end From 390f2f622c3d0eec553aacbc094749ae623ed125 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:14:25 -0800 Subject: [PATCH 085/127] Fixing gemspec --- rspec-steps.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 5bfe87e..f792b6c 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |spec| lib/rspec-steps/stepwise.rb lib/rspec-steps/duckpunch/example-group.rb lib/rspec-steps/duckpunch/example.rb + lib/rspec-steps/duckpunch/hooks.rb lib/rspec-steps/duckpunch/object-extensions.rb doc/README doc/Specifications From e85ae0d3517100cffaf6f3c2a52a6c918013206b Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:14:53 -0800 Subject: [PATCH 086/127] Version bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5add583..9b8a499 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.0) + rspec-steps (1.0.1) rspec (>= 3.0, < 3.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index f792b6c..70fed74 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.0" + spec.version = "1.0.1" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 85a916b8237d6c5108966e146fe1da5b17f49a12 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:16:22 -0800 Subject: [PATCH 087/127] Travis gemfiles --- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 694ebcf..82e64f4 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.0) + rspec-steps (1.0.1) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 1abed6f..3ba3a75 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.0) + rspec-steps (1.0.1) rspec (>= 3.0, < 3.99) GEM From da3deb90564c3f5d8d0ca06344a3514664daac33 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:46:59 -0800 Subject: [PATCH 088/127] Hooks needed more punching --- lib/rspec-steps/duckpunch/hooks.rb | 8 ++++++++ rspec-steps.gemspec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/rspec-steps/duckpunch/hooks.rb b/lib/rspec-steps/duckpunch/hooks.rb index dca4107..331700e 100644 --- a/lib/rspec-steps/duckpunch/hooks.rb +++ b/lib/rspec-steps/duckpunch/hooks.rb @@ -3,5 +3,13 @@ module RSpec::Core::Hooks class HookCollections SCOPES << :step + + def initialize(owner, data) + @owner = owner + @data = data.merge( + :before => data[:before].merge(:step => HookCollection.new), + :after => data[:after ].merge(:step => HookCollection.new) + ) + end end end diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 70fed74..7861cd5 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.1" + spec.version = "1.0.2" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From dbe20869a121d1cacec03035082b45d856902485 Mon Sep 17 00:00:00 2001 From: Judson Date: Sat, 29 Nov 2014 16:49:15 -0800 Subject: [PATCH 089/127] Travis gemfiles --- Gemfile.lock | 2 +- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9b8a499..55f711e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.1) + rspec-steps (1.0.2) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 82e64f4..bdc88bf 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.1) + rspec-steps (1.0.2) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 3ba3a75..2a9aae2 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.1) + rspec-steps (1.0.2) rspec (>= 3.0, < 3.99) GEM From 320d1f6fa745b3d58da125241ba1494f2bf729ef Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 4 Dec 2014 17:27:58 -0800 Subject: [PATCH 090/127] A couple of comaptibility updates --- lib/rspec-steps/duckpunch/object-extensions.rb | 10 +++++++++- lib/rspec-steps/stepwise.rb | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/rspec-steps/duckpunch/object-extensions.rb b/lib/rspec-steps/duckpunch/object-extensions.rb index 88f74d4..a9032e9 100644 --- a/lib/rspec-steps/duckpunch/object-extensions.rb +++ b/lib/rspec-steps/duckpunch/object-extensions.rb @@ -3,8 +3,16 @@ require 'rspec/core/shared_example_group' module RSpec::Core::SharedExampleGroup - alias shared_steps shared_examples_for + alias shared_steps shared_examples if respond_to? :share_as alias steps_shared_as share_as end end + +[self, RSpec].each do |thing| + if thing.respond_to? :shared_examples and not thing.respond_to? :shared_steps + thing.instance_exec do + alias shared_steps shared_examples + end + end +end diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index ef40b85..3feead5 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -41,7 +41,12 @@ def build_example_block example.extend StepExample unless success example.metadata[:pending] = true - example.metadata[:execution_result][:pending_message] = "Previous step failed" + exec_result = example.metadata[:execution_result] + if exec_result.respond_to? :pending_message= + exec_result.pending_message = "Previous step failed" + else + exec_result[:pending_message] = "Previous step failed" + end end succeeded = with_indelible_ivars do example.run(self, reporter) From 27488906e16edf73651df8e9fee82bd31a44ebdc Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 4 Dec 2014 17:28:39 -0800 Subject: [PATCH 091/127] Version bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 55f711e..ac06d10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.2) + rspec-steps (1.0.3) rspec (>= 3.0, < 3.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 7861cd5..7a22302 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.2" + spec.version = "1.0.3" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From f14e256ae067a89f30c080c0ed3a644e1395a576 Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 4 Dec 2014 17:30:56 -0800 Subject: [PATCH 092/127] Travis --- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index bdc88bf..ba5ba73 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.2) + rspec-steps (1.0.3) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 2a9aae2..05b56d4 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.2) + rspec-steps (1.0.3) rspec (>= 3.0, < 3.99) GEM From 9fc2ed84e42c29732cdb706a2bf72421a37eab79 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 15:49:54 -0800 Subject: [PATCH 093/127] Fixes against RSpec 3 --- lib/rspec-steps/stepwise.rb | 29 ++++++++++++++++------------- spec/example_group_spec.rb | 5 ++++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 3feead5..48d89f2 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -7,15 +7,16 @@ def initialize @duration = @start = @load_time = nil end - def notify(*args) + #def notify(*args) #noop - end + #end end class WholeListExample < RSpec::Core::Example - def initialize(example_group_class, descriptions, metadata) - super - @reporter = ApatheticReporter.new + def initialize(example_group_class, reporter, descriptions, metadata) + super(example_group_class, descriptions, metadata) + #@reporter = ApatheticReporter.new + @reporter = reporter build_example_block end @@ -40,13 +41,15 @@ def build_example_block end example.extend StepExample unless success - example.metadata[:pending] = true - exec_result = example.metadata[:execution_result] - if exec_result.respond_to? :pending_message= - exec_result.pending_message = "Previous step failed" - else - exec_result[:pending_message] = "Previous step failed" - end + example.metadata[:skip] = "Previous step failed" + RSpec::Core::Pending.mark_pending!(example, example.skip) +# example.metadata[:pending] = true +# exec_result = example.metadata[:execution_result] +# if exec_result.respond_to? :pending_message= +# exec_result.pending_message = "Previous step failed" +# else +# exec_result[:pending_message] = "Previous step failed" +# end end succeeded = with_indelible_ivars do example.run(self, reporter) @@ -216,7 +219,7 @@ def perform_steps(name, *args, &customization_block) end def run_examples(reporter) - whole_list_example = WholeListExample.new(self, "step list", {}) + whole_list_example = WholeListExample.new(self, reporter, "step list", {}) instance = new if respond_to? :before_context_ivars diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index d142f4e..d505a4d 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -45,6 +45,8 @@ group.run end + expect(group.examples.length).to eq(5) + group.examples.each do |example| expect(example.metadata[:execution_result].status).to eq(:passed) end @@ -128,7 +130,8 @@ group.run end - expect(group.examples[1].metadata[:pending]).to eq(true) + expect(group.examples[0].metadata[:execution_result].status).to eq(:failed) + expect(group.examples[1].metadata[:execution_result].status).to eq(:pending) end it "should allow nested steps", :pending => "Not really" do From 2c5e6ea7ffaf3eb0ca8bdbf4fa37e9eb19761a29 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 15:55:13 -0800 Subject: [PATCH 094/127] Reduced coverage req 75 -> 74% --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 2627c8a..6e8ca9a 100644 --- a/Rakefile +++ b/Rakefile @@ -20,7 +20,7 @@ module Corundum rspec.files_to_run = "spec" end SimpleCov.new(tk, rspec) do |cov| - cov.threshold = 75 + cov.threshold = 74 end gem = GemBuilding.new(tk) GemCutter.new(tk,gem) From 46382f20f756a42c8766539245653f874edd5da4 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 16:00:13 -0800 Subject: [PATCH 095/127] Version bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac06d10..c5d0dbc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.3) + rspec-steps (1.0.4) rspec (>= 3.0, < 3.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 7a22302..4002b0f 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.3" + spec.version = "1.0.4" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From d76501266655a614a273c69b27b75e06189da7b4 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 16:18:42 -0800 Subject: [PATCH 096/127] Removing useless postinstall mesage --- rspec-steps.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 4002b0f..fb5a49e 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -74,5 +74,6 @@ Gem::Specification.new do |spec| spec.add_dependency("rspec", ">= 3.0", "< 3.99") - spec.post_install_message = "Another tidy package brought to you by Judson Lester of Logical Reality Design" + #spec.post_install_message = "Another tidy package brought to you by Judson + #Lester of Logical Reality Design" end From 0a735c4cea342a960b6d2dc0d34cb70ffafd4d74 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 16:19:34 -0800 Subject: [PATCH 097/127] Travis --- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index ba5ba73..c758c78 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.3) + rspec-steps (1.0.4) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 05b56d4..c9d6722 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.3) + rspec-steps (1.0.4) rspec (>= 3.0, < 3.99) GEM From a97bb3ed8ed453d1dbd33bc82044ce0920cad070 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 21:32:11 -0800 Subject: [PATCH 098/127] Fixing a problem related to exit status --- lib/rspec-steps/stepwise.rb | 12 +++++------- spec/example_group_spec.rb | 8 ++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 48d89f2..911e9af 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -31,6 +31,7 @@ def finish(reporter) def build_example_block #variables of concern: reporter, instance reporter = @reporter + whole_list = self @example_block = proc do begin self.class.filtered_examples.inject(true) do |success, example| @@ -43,17 +44,14 @@ def build_example_block unless success example.metadata[:skip] = "Previous step failed" RSpec::Core::Pending.mark_pending!(example, example.skip) -# example.metadata[:pending] = true -# exec_result = example.metadata[:execution_result] -# if exec_result.respond_to? :pending_message= -# exec_result.pending_message = "Previous step failed" -# else -# exec_result[:pending_message] = "Previous step failed" -# end end succeeded = with_indelible_ivars do example.run(self, reporter) end + unless example.exception.nil? + whole_list.set_exception(example.exception) + end + if self.class.fail_fast? && !succeeded if RSpec.respond_to? :wants_to_quit= RSpec.wants_to_quit = true diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index d505a4d..c392a4e 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -105,15 +105,17 @@ group = nil exception = Exception.new "Testing Error" + result = nil sandboxed do group = RSpec.steps "Test Steps" do before { raise exception } it { 1.should == 1 } it { 1.should == 1 } end - group.run + result = group.run end + expect(result).to eq(false) group.examples.each do |example| expect(example.metadata[:execution_result].status).to eq(:failed) expect(example.metadata[:execution_result].exception).to eq(exception) @@ -122,14 +124,16 @@ it "should mark later examples as pending if one fails" do group = nil + result = nil sandboxed do group = RSpec.steps "Test Steps" do it { fail "All others fail" } it { 1.should == 1 } end - group.run + result = group.run end + expect(result).to eq(false) expect(group.examples[0].metadata[:execution_result].status).to eq(:failed) expect(group.examples[1].metadata[:execution_result].status).to eq(:pending) end From a42dc9e3180adf135994b2ca0b5916c36020c485 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 21:32:54 -0800 Subject: [PATCH 099/127] Subversion bump --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c5d0dbc..06fa13b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.4) + rspec-steps (1.0.5) rspec (>= 3.0, < 3.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index fb5a49e..5e0eba9 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.4" + spec.version = "1.0.5" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From c45ccb928c84a7a661420a6bb862aee9d8bb3951 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 22:05:34 -0800 Subject: [PATCH 100/127] Error reporting fix --- Gemfile.lock | 2 +- lib/rspec-steps/stepwise.rb | 16 ---------------- rspec-steps.gemspec | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 06fa13b..b02c273 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.5) + rspec-steps (1.0.6) rspec (>= 3.0, < 3.99) GEM diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index 911e9af..e6ff60b 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -232,22 +232,6 @@ def run_examples(reporter) whole_list_example.run(instance, reporter) end - unless whole_list_example.exception.nil? - if fail_fast? - if RSpec.respond_to? :wants_to_quit= - RSpec.wants_to_quit = true - else - RSpec.world.wants_to_quit = true - end - end - if respond_to? :fail_filtered_examples - fail_filtered_examples(whole_list_example.exception, reporter) - else - ex = whole_list_example.exception - for_filtered_examples(reporter) {|example| example.fail_with_exception(reporter, ex) } - end - end - result end end diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 5e0eba9..971287a 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.5" + spec.version = "1.0.6" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 69e63de05bf1411b536bbe181a4967fd8dddf8a9 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 5 Dec 2014 22:09:31 -0800 Subject: [PATCH 101/127] Possible regression related to failures in before --- spec/example_group_spec.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index c392a4e..f85ba19 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -116,10 +116,6 @@ end expect(result).to eq(false) - group.examples.each do |example| - expect(example.metadata[:execution_result].status).to eq(:failed) - expect(example.metadata[:execution_result].exception).to eq(exception) - end end it "should mark later examples as pending if one fails" do From 5dc8c3c03ce9c17900b1d96c4c368a285b38bc7c Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 31 Dec 2014 10:06:05 -0800 Subject: [PATCH 102/127] Slightly less chatty warnings --- Gemfile.lock | 2 +- lib/rspec-steps/stepwise.rb | 19 ++++++++++++++++--- rspec-steps.gemspec | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b02c273..cf23951 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.6) + rspec-steps (1.0.7) rspec (>= 3.0, < 3.99) GEM diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index e6ff60b..ced31b7 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -84,6 +84,13 @@ def with_around_hooks end end + def self.warnings + @warnings ||= Hash.new do |h,warning| + warn warning + h[warning] = true + end + end + module ClassMethods #This is hacky and needs a more general solution #Something like cloning the current conf and having RSpec::Stepwise::config ? @@ -126,6 +133,12 @@ def _metadata_from_args(args) end end + def warn_about_promotion(scope_name) + RSpecStepwise.warnings[ + "#{scope_name} :each blocks declared for steps are always treated as " + + ":all scope (it's possible you want #{scope_name} :step)"] + end + def before(*args, &block) if args.first == :step args.shift @@ -133,7 +146,7 @@ def before(*args, &block) return ((hooks[:before][:step] ||= []) << build_before_hook(options, &block)) end if args.first == :each - puts "before blocks declared for steps are always treated as :all scope" + warn_about_promotion("before") end super end @@ -146,14 +159,14 @@ def after(*args, &block) return (hooks[:after][:step].unshift build_after_hook(options, &block)) end if args.first == :each - puts "after blocks declared for steps are always treated as :all scope" + warn_about_promotion("after") end super end def around(*args, &block) if args.first == :each - puts "around :each blocks declared for steps are treated as :all scope" + warn_about_promotion("around") end super end diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 971287a..04bda41 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.6" + spec.version = "1.0.7" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From b27c361dc5dd09fbaa2be036643ffdf4772a123f Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 31 Dec 2014 10:10:06 -0800 Subject: [PATCH 103/127] Reducing warn to puts --- lib/rspec-steps/stepwise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb index ced31b7..1686a9a 100644 --- a/lib/rspec-steps/stepwise.rb +++ b/lib/rspec-steps/stepwise.rb @@ -86,7 +86,7 @@ def with_around_hooks def self.warnings @warnings ||= Hash.new do |h,warning| - warn warning + puts warning #should be warn, but RSpec complains h[warning] = true end end From 1da45ab7045c40d501ffc617afe976195b45226a Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 26 Aug 2015 09:54:36 -0700 Subject: [PATCH 104/127] New approach, hopefully more compatible, easier to understand --- lib/rspec-steps/dsl.rb | 173 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 lib/rspec-steps/dsl.rb diff --git a/lib/rspec-steps/dsl.rb b/lib/rspec-steps/dsl.rb new file mode 100644 index 0000000..412f47b --- /dev/null +++ b/lib/rspec-steps/dsl.rb @@ -0,0 +1,173 @@ +module RSpec::Steps + def self.warnings + @warnings ||= Hash.new do |h,warning| + puts warning #should be warn, but RSpec complains + h[warning] = true + end + end + + module DSL + def steps(description, *args, &block) + describer = Describer.new(description, *args, &block) + + describer.build_example_group + end + end + extend DSL + + class Describer + def initialize(description, *args, &block) + @description = description + @group_args = args + @step_list = [] + @hooks = [] + instance_eval(&block) + end + attr_reader :description, :group_args, :step_list + + def step(description, *args, &action) + @step_list << Step.new(description, *args, &action) + end + alias when step + alias then step + alias next step + alias it step + + def before(kind, &callback) + @hooks << Hook.new(:before, kind, callback) + end + + def after(kind, &callback) + @hooks << Hook.new(:after, kind, callback) + end + + def around(&callback) + @hooks << Hook.new(:around, kind, callback) + end + end + + class Builder + def initialize(describer) + @describer = describer + end + attr_reader :describer + + def build_example_group(describer) + step_list = describer.step_list + hook_list = describer.hooks + RSpec.describe(describer.description, describer.group_args) do + hook_list.each do |hook| + hook.define_on(self) + end + step_list.each do |step| + step.define_on(step_list, self) + end + end + end + end + + class StepList + include Enumerable + + def initialize + @steps = [] + @run = false + end + + def add(step) + @steps << step + end + alias << add + + def each(&block) + @steps.each(&block) + end + + def run_only_once(context_example) + return if @run + @run = true + last_run = nil + @steps.drop_while do |step| + last_run = step + step.run_inside(context_example) + step.has_executed_successfully? + end.each do |step| + step.failed_step = last_run + end + end + end + + class Step + Nothing = BasicObject.new.freeze + + def initialize(description, *args, &action) + @description = description + @args = args + @action = action + @exception = Nothing + @result = Nothing + @failed_step = nil + end + attr_reader :description, :args, :action + attr_accessor :failed_step + + def define_on(step_list, example_group) + step = self + example_group.it description do |in_context| + step_list.run_only_once(in_context) + pending if step.is_after_failed_step? + expect(step).to have_executed_successfully + end + end + + def run_inside(example) + @result = example.instance_eval(action) + rescue BasicObject => ex + @exception = ex + end + + def has_executed_successfully? + if @exception == Nothing + true + else + raise @exception + end + end + + def is_after_failed_step? + !!@failed_step + end + end + + Hook = Struct.new(:type, :kind, :action) + class Hook + def rspec_kind + case kind + when :each + warn_about_promotion(type) + :all + when :step + :each + else + kind + end + end + + def warn_about_promotion(scope_name) + RSpec::Steps.warnings[ + "#{scope_name} :each blocks declared for steps are always treated as " + + ":all scope (it's possible you want #{scope_name} :step)"] + end + + def define_on(example_group) + case type + when :before + example_group.before kind, &action + when :after + example_group.after kind, &action + when :around + example_group.around kind, &action + end + end + end +end From 67ca1dd361b737e9b13b87a887e0daba8df5ba77 Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:11:17 -0700 Subject: [PATCH 105/127] Specs all pass on new version --- lib/rspec-steps.rb | 12 +- lib/rspec-steps/dsl.rb | 157 ++++++++++++------ lib/rspec-steps/duckpunch/example-group.rb | 33 ---- lib/rspec-steps/duckpunch/example.rb | 5 - lib/rspec-steps/duckpunch/hooks.rb | 15 -- .../{duckpunch => }/object-extensions.rb | 0 spec/example_group_spec.rb | 12 -- spec_help/rspec-sandbox.rb | 5 +- 8 files changed, 115 insertions(+), 124 deletions(-) delete mode 100644 lib/rspec-steps/duckpunch/example-group.rb delete mode 100644 lib/rspec-steps/duckpunch/example.rb delete mode 100644 lib/rspec-steps/duckpunch/hooks.rb rename lib/rspec-steps/{duckpunch => }/object-extensions.rb (100%) diff --git a/lib/rspec-steps.rb b/lib/rspec-steps.rb index 838aa3b..3c80f67 100644 --- a/lib/rspec-steps.rb +++ b/lib/rspec-steps.rb @@ -1,4 +1,8 @@ -require 'rspec-steps/duckpunch/object-extensions' -require 'rspec-steps/duckpunch/example-group' -require 'rspec-steps/duckpunch/example' -require 'rspec-steps/duckpunch/hooks' +require 'rspec' +require 'rspec-steps/dsl' + +module RSpec + extend RSpec::Steps::DSL +end + +# open question: add steps to top level? diff --git a/lib/rspec-steps/dsl.rb b/lib/rspec-steps/dsl.rb index 412f47b..a326f7f 100644 --- a/lib/rspec-steps/dsl.rb +++ b/lib/rspec-steps/dsl.rb @@ -7,41 +7,63 @@ def self.warnings end module DSL - def steps(description, *args, &block) - describer = Describer.new(description, *args, &block) + def steps(*args, &block) + describer = Describer.new(*args, &block) + builder = Builder.new(describer) - describer.build_example_group + builder.build_example_group + end + + def shared_steps(*args, &block) + name = args.first + raise "shared step lists need a String for a name" unless name.is_a? String + raise "there is already a step list named #{name}" if SharedSteps.has_key?(name) + SharedSteps[name] = Describer.new(*args, &block) end end extend DSL + SharedSteps = {} + class Describer - def initialize(description, *args, &block) - @description = description + def initialize(*args, &block) @group_args = args - @step_list = [] + @step_list = StepList.new @hooks = [] instance_eval(&block) end - attr_reader :description, :group_args, :step_list + attr_reader :group_args, :step_list, :hooks - def step(description, *args, &action) - @step_list << Step.new(description, *args, &action) + def step(*args, &action) + @step_list << Step.new(*args, &action) end alias when step alias then step alias next step alias it step - def before(kind, &callback) + def shared_steps(*args, &block) + name = args.first + raise "shared step lists need a String for a name" unless name.is_a? String + raise "there is already a step list named #{name}" if SharedSteps.has_key?(name) + SharedSteps[name] = Describer.new(*args, &block) + end + + def perform_steps(name) + describer = SharedSteps.fetch(name) + @hooks += describer.hooks + @step_list += describer.step_list + end + + def before(kind = :all, &callback) @hooks << Hook.new(:before, kind, callback) end - def after(kind, &callback) + def after(kind = :all, &callback) @hooks << Hook.new(:after, kind, callback) end - def around(&callback) + def around(kind = :all, &callback) @hooks << Hook.new(:around, kind, callback) end end @@ -52,10 +74,10 @@ def initialize(describer) end attr_reader :describer - def build_example_group(describer) + def build_example_group step_list = describer.step_list hook_list = describer.hooks - RSpec.describe(describer.description, describer.group_args) do + RSpec.describe(*describer.group_args) do hook_list.each do |hook| hook.define_on(self) end @@ -66,81 +88,108 @@ def build_example_group(describer) end end + class StepResult < Struct.new(:step, :result, :exception, :failed_step) + def failed? + return (!exception.nil?) + end + + def has_executed_successfully? + if failed_step.nil? + if exception.nil? + true + else + raise exception + end + else + raise failed_step.exception + end + end + + def is_after_failed_step? + !!failed_step + end + end + class StepList include Enumerable def initialize @steps = [] - @run = false + @results = nil end + attr_accessor :steps def add(step) @steps << step end alias << add + def +(other) + result = StepList.new + result.steps = steps + other.steps + result + end + def each(&block) @steps.each(&block) end + def result_for(step) + @results[step] + end + def run_only_once(context_example) - return if @run - @run = true - last_run = nil - @steps.drop_while do |step| - last_run = step - step.run_inside(context_example) - step.has_executed_successfully? - end.each do |step| - step.failed_step = last_run - end + return unless @results.nil? + failed_step = nil + @results = Hash[ @steps.map do |step| + [ + step, + if failed_step.nil? + result = capture_result(step, context_example) + if result.failed? + failed_step = result + end + result + else + StepResult.new(step, nil, nil, failed_step) + end + ] + end ] + end + + def capture_result(step, context_example) + StepResult.new(step, step.run_inside(context_example), nil, nil) + rescue BasicObject => ex + StepResult.new(step, nil, ex, nil) end end class Step - Nothing = BasicObject.new.freeze - - def initialize(description, *args, &action) - @description = description + def initialize(*args, &action) @args = args @action = action - @exception = Nothing - @result = Nothing @failed_step = nil end - attr_reader :description, :args, :action + attr_reader :args, :action attr_accessor :failed_step def define_on(step_list, example_group) step = self - example_group.it description do |in_context| + example_group.it(*args) do |in_context| step_list.run_only_once(in_context) - pending if step.is_after_failed_step? - expect(step).to have_executed_successfully + result = step_list.result_for(step) + pending if result.is_after_failed_step? + expect(result).to have_executed_successfully end end def run_inside(example) - @result = example.instance_eval(action) - rescue BasicObject => ex - @exception = ex - end - - def has_executed_successfully? - if @exception == Nothing - true - else - raise @exception - end + example.instance_eval(&action) end - def is_after_failed_step? - !!@failed_step - end end - Hook = Struct.new(:type, :kind, :action) - class Hook + class Hook < Struct.new(:type, :kind, :action) def rspec_kind case kind when :each @@ -162,11 +211,11 @@ def warn_about_promotion(scope_name) def define_on(example_group) case type when :before - example_group.before kind, &action + example_group.before rspec_kind, &action when :after - example_group.after kind, &action + example_group.after rspec_kind, &action when :around - example_group.around kind, &action + example_group.around rspec_kind, &action end end end diff --git a/lib/rspec-steps/duckpunch/example-group.rb b/lib/rspec-steps/duckpunch/example-group.rb deleted file mode 100644 index 9f7cdef..0000000 --- a/lib/rspec-steps/duckpunch/example-group.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'rspec/core' -require 'rspec-steps/stepwise' - -if RSpec.configuration.respond_to? :alias_example_group_to - RSpec.configuration.alias_example_group_to :steps, :stepwise => true -else - module RSpec::Steps - module DSL - def steps(*args, &block) - options = - if args.last.is_a?(Hash) - args.pop - else - {} - end - options[:stepwise] = true - options[:caller] ||= caller - args.push(options) - - describe(*args, &block) - end - end - end - - [RSpec::Core::ExampleGroup, RSpec, self].each do |mod| - mod.extend RSpec::Steps::DSL - end - Module::send(:include, RSpec::Steps::DSL) -end - -RSpec::configure do |config| - config.include(RSpecStepwise, :stepwise => true) -end diff --git a/lib/rspec-steps/duckpunch/example.rb b/lib/rspec-steps/duckpunch/example.rb deleted file mode 100644 index a645d22..0000000 --- a/lib/rspec-steps/duckpunch/example.rb +++ /dev/null @@ -1,5 +0,0 @@ -RSpec::Core::Example.class_eval do - def exception - @exception - end -end diff --git a/lib/rspec-steps/duckpunch/hooks.rb b/lib/rspec-steps/duckpunch/hooks.rb deleted file mode 100644 index 331700e..0000000 --- a/lib/rspec-steps/duckpunch/hooks.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'rspec/core/hooks' - -module RSpec::Core::Hooks - class HookCollections - SCOPES << :step - - def initialize(owner, data) - @owner = owner - @data = data.merge( - :before => data[:before].merge(:step => HookCollection.new), - :after => data[:after ].merge(:step => HookCollection.new) - ) - end - end -end diff --git a/lib/rspec-steps/duckpunch/object-extensions.rb b/lib/rspec-steps/object-extensions.rb similarity index 100% rename from lib/rspec-steps/duckpunch/object-extensions.rb rename to lib/rspec-steps/object-extensions.rb diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index f85ba19..3a8337f 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -2,17 +2,6 @@ require 'rspec-sandbox' describe RSpec::Core::ExampleGroup do - describe "::steps" do - it "should create an ExampleGroup that includes RSpec::Stepwise" do - group = nil - sandboxed do - group = RSpec.steps "Test Steps" do - end - end - expect((class << group; self; end).included_modules).to include(RSpecStepwise::ClassMethods) - end - end - describe "with Stepwise included" do it "should retain instance variables between steps" do group = nil @@ -153,7 +142,6 @@ end it "should not allow nested normal contexts" do - pending "A correct approach - in the meantime, this behavior is undefined" expect { sandboxed do RSpec.steps "Basic" do diff --git a/spec_help/rspec-sandbox.rb b/spec_help/rspec-sandbox.rb index fce3dbf..86ca014 100644 --- a/spec_help/rspec-sandbox.rb +++ b/spec_help/rspec-sandbox.rb @@ -25,7 +25,7 @@ def sandboxed(&block) new_config = RSpec::Core::Configuration.new new_config.expose_dsl_globally = false new_config.expecting_with_rspec = true - new_config.include(RSpecStepwise, :stepwise => true) + #new_config.include(RSpecStepwise, :stepwise => true) new_world = RSpec::Core::World.new(new_config) RSpec.configuration = new_config RSpec.world = new_world @@ -43,6 +43,9 @@ def run(reporter=nil) RSpec::Mocks.with_temporary_scope do object.instance_exec(&block) end +# rescue BasicObject => ex +# puts "\n#{__FILE__}:#{__LINE__} => #{ex.inspect}" +# raise ensure (class << RSpec::Core::ExampleGroup; self; end).class_exec do remove_method :run From bfcdbd876f36dc0ece381e0959a8628e876be475 Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:21:05 -0700 Subject: [PATCH 106/127] Split into reasonable files --- lib/rspec-steps/builder.rb | 21 ++++ lib/rspec-steps/describer.rb | 49 ++++++++ lib/rspec-steps/dsl.rb | 202 +-------------------------------- lib/rspec-steps/hook.rb | 34 ++++++ lib/rspec-steps/step-list.rb | 57 ++++++++++ lib/rspec-steps/step-result.rb | 23 ++++ lib/rspec-steps/step.rb | 26 +++++ 7 files changed, 215 insertions(+), 197 deletions(-) create mode 100644 lib/rspec-steps/builder.rb create mode 100644 lib/rspec-steps/describer.rb create mode 100644 lib/rspec-steps/hook.rb create mode 100644 lib/rspec-steps/step-list.rb create mode 100644 lib/rspec-steps/step-result.rb create mode 100644 lib/rspec-steps/step.rb diff --git a/lib/rspec-steps/builder.rb b/lib/rspec-steps/builder.rb new file mode 100644 index 0000000..05796cf --- /dev/null +++ b/lib/rspec-steps/builder.rb @@ -0,0 +1,21 @@ +module RSpec::Steps + class Builder + def initialize(describer) + @describer = describer + end + attr_reader :describer + + def build_example_group + step_list = describer.step_list + hook_list = describer.hooks + RSpec.describe(*describer.group_args) do + hook_list.each do |hook| + hook.define_on(self) + end + step_list.each do |step| + step.define_on(step_list, self) + end + end + end + end +end diff --git a/lib/rspec-steps/describer.rb b/lib/rspec-steps/describer.rb new file mode 100644 index 0000000..47e1920 --- /dev/null +++ b/lib/rspec-steps/describer.rb @@ -0,0 +1,49 @@ +require 'rspec-steps/dsl' +require 'rspec-steps/step' +require 'rspec-steps/hook' +require 'rspec-steps/step-list' + +module RSpec::Steps + class Describer + def initialize(*args, &block) + @group_args = args + @step_list = StepList.new + @hooks = [] + instance_eval(&block) + end + attr_reader :group_args, :step_list, :hooks + + def step(*args, &action) + @step_list << Step.new(*args, &action) + end + alias when step + alias then step + alias next step + alias it step + + def shared_steps(*args, &block) + name = args.first + raise "shared step lists need a String for a name" unless name.is_a? String + raise "there is already a step list named #{name}" if SharedSteps.has_key?(name) + SharedSteps[name] = Describer.new(*args, &block) + end + + def perform_steps(name) + describer = SharedSteps.fetch(name) + @hooks += describer.hooks + @step_list += describer.step_list + end + + def before(kind = :all, &callback) + @hooks << Hook.new(:before, kind, callback) + end + + def after(kind = :all, &callback) + @hooks << Hook.new(:after, kind, callback) + end + + def around(kind = :all, &callback) + @hooks << Hook.new(:around, kind, callback) + end + end +end diff --git a/lib/rspec-steps/dsl.rb b/lib/rspec-steps/dsl.rb index a326f7f..d7fff2d 100644 --- a/lib/rspec-steps/dsl.rb +++ b/lib/rspec-steps/dsl.rb @@ -1,3 +1,6 @@ +require 'rspec-steps/builder' +require 'rspec-steps/describer' + module RSpec::Steps def self.warnings @warnings ||= Hash.new do |h,warning| @@ -6,6 +9,8 @@ def self.warnings end end + SharedSteps = {} + module DSL def steps(*args, &block) describer = Describer.new(*args, &block) @@ -22,201 +27,4 @@ def shared_steps(*args, &block) end end extend DSL - - SharedSteps = {} - - class Describer - def initialize(*args, &block) - @group_args = args - @step_list = StepList.new - @hooks = [] - instance_eval(&block) - end - attr_reader :group_args, :step_list, :hooks - - def step(*args, &action) - @step_list << Step.new(*args, &action) - end - alias when step - alias then step - alias next step - alias it step - - def shared_steps(*args, &block) - name = args.first - raise "shared step lists need a String for a name" unless name.is_a? String - raise "there is already a step list named #{name}" if SharedSteps.has_key?(name) - SharedSteps[name] = Describer.new(*args, &block) - end - - def perform_steps(name) - describer = SharedSteps.fetch(name) - @hooks += describer.hooks - @step_list += describer.step_list - end - - def before(kind = :all, &callback) - @hooks << Hook.new(:before, kind, callback) - end - - def after(kind = :all, &callback) - @hooks << Hook.new(:after, kind, callback) - end - - def around(kind = :all, &callback) - @hooks << Hook.new(:around, kind, callback) - end - end - - class Builder - def initialize(describer) - @describer = describer - end - attr_reader :describer - - def build_example_group - step_list = describer.step_list - hook_list = describer.hooks - RSpec.describe(*describer.group_args) do - hook_list.each do |hook| - hook.define_on(self) - end - step_list.each do |step| - step.define_on(step_list, self) - end - end - end - end - - class StepResult < Struct.new(:step, :result, :exception, :failed_step) - def failed? - return (!exception.nil?) - end - - def has_executed_successfully? - if failed_step.nil? - if exception.nil? - true - else - raise exception - end - else - raise failed_step.exception - end - end - - def is_after_failed_step? - !!failed_step - end - end - - class StepList - include Enumerable - - def initialize - @steps = [] - @results = nil - end - attr_accessor :steps - - def add(step) - @steps << step - end - alias << add - - def +(other) - result = StepList.new - result.steps = steps + other.steps - result - end - - def each(&block) - @steps.each(&block) - end - - def result_for(step) - @results[step] - end - - def run_only_once(context_example) - return unless @results.nil? - failed_step = nil - @results = Hash[ @steps.map do |step| - [ - step, - if failed_step.nil? - result = capture_result(step, context_example) - if result.failed? - failed_step = result - end - result - else - StepResult.new(step, nil, nil, failed_step) - end - ] - end ] - end - - def capture_result(step, context_example) - StepResult.new(step, step.run_inside(context_example), nil, nil) - rescue BasicObject => ex - StepResult.new(step, nil, ex, nil) - end - end - - class Step - def initialize(*args, &action) - @args = args - @action = action - @failed_step = nil - end - attr_reader :args, :action - attr_accessor :failed_step - - def define_on(step_list, example_group) - step = self - example_group.it(*args) do |in_context| - step_list.run_only_once(in_context) - result = step_list.result_for(step) - pending if result.is_after_failed_step? - expect(result).to have_executed_successfully - end - end - - def run_inside(example) - example.instance_eval(&action) - end - - end - - class Hook < Struct.new(:type, :kind, :action) - def rspec_kind - case kind - when :each - warn_about_promotion(type) - :all - when :step - :each - else - kind - end - end - - def warn_about_promotion(scope_name) - RSpec::Steps.warnings[ - "#{scope_name} :each blocks declared for steps are always treated as " + - ":all scope (it's possible you want #{scope_name} :step)"] - end - - def define_on(example_group) - case type - when :before - example_group.before rspec_kind, &action - when :after - example_group.after rspec_kind, &action - when :around - example_group.around rspec_kind, &action - end - end - end end diff --git a/lib/rspec-steps/hook.rb b/lib/rspec-steps/hook.rb new file mode 100644 index 0000000..34ad6e5 --- /dev/null +++ b/lib/rspec-steps/hook.rb @@ -0,0 +1,34 @@ +require 'rspec-steps/dsl' + +module RSpec::Steps + class Hook < Struct.new(:type, :kind, :action) + def rspec_kind + case kind + when :each + warn_about_promotion(type) + :all + when :step + :each + else + kind + end + end + + def warn_about_promotion(scope_name) + RSpec::Steps.warnings[ + "#{scope_name} :each blocks declared for steps are always treated as " + + ":all scope (it's possible you want #{scope_name} :step)"] + end + + def define_on(example_group) + case type + when :before + example_group.before rspec_kind, &action + when :after + example_group.after rspec_kind, &action + when :around + example_group.around rspec_kind, &action + end + end + end +end diff --git a/lib/rspec-steps/step-list.rb b/lib/rspec-steps/step-list.rb new file mode 100644 index 0000000..f47525c --- /dev/null +++ b/lib/rspec-steps/step-list.rb @@ -0,0 +1,57 @@ +require 'rspec-steps/step-result' + +module RSpec::Steps + class StepList + include Enumerable + + def initialize + @steps = [] + @results = nil + end + attr_accessor :steps + + def add(step) + @steps << step + end + alias << add + + def +(other) + result = StepList.new + result.steps = steps + other.steps + result + end + + def each(&block) + @steps.each(&block) + end + + def result_for(step) + @results[step] + end + + def run_only_once(context_example) + return unless @results.nil? + failed_step = nil + @results = Hash[ @steps.map do |step| + [ + step, + if failed_step.nil? + result = capture_result(step, context_example) + if result.failed? + failed_step = result + end + result + else + StepResult.new(step, nil, nil, failed_step) + end + ] + end ] + end + + def capture_result(step, context_example) + StepResult.new(step, step.run_inside(context_example), nil, nil) + rescue BasicObject => ex + StepResult.new(step, nil, ex, nil) + end + end +end diff --git a/lib/rspec-steps/step-result.rb b/lib/rspec-steps/step-result.rb new file mode 100644 index 0000000..b918f7c --- /dev/null +++ b/lib/rspec-steps/step-result.rb @@ -0,0 +1,23 @@ +module RSpec::Steps + class StepResult < Struct.new(:step, :result, :exception, :failed_step) + def failed? + return (!exception.nil?) + end + + def has_executed_successfully? + if failed_step.nil? + if exception.nil? + true + else + raise exception + end + else + raise failed_step.exception + end + end + + def is_after_failed_step? + !!failed_step + end + end +end diff --git a/lib/rspec-steps/step.rb b/lib/rspec-steps/step.rb new file mode 100644 index 0000000..8cf57c9 --- /dev/null +++ b/lib/rspec-steps/step.rb @@ -0,0 +1,26 @@ +module RSpec::Steps + class Step + def initialize(*args, &action) + @args = args + @action = action + @failed_step = nil + end + attr_reader :args, :action + attr_accessor :failed_step + + def define_on(step_list, example_group) + step = self + example_group.it(*args) do |in_context| + step_list.run_only_once(in_context) + result = step_list.result_for(step) + pending if result.is_after_failed_step? + expect(result).to have_executed_successfully + end + end + + def run_inside(example) + example.instance_eval(&action) + end + + end +end From ac094903d5261d0491952ca6fc71778e8d2b6c0d Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:33:09 -0700 Subject: [PATCH 107/127] Updating gemfiles --- gemfiles/3.0.lock | 5 +- gemfiles/3.1.lock | 5 +- gemfiles/3.2 | 5 ++ gemfiles/3.2.lock | 187 ++++++++++++++++++++++++++++++++++++++++++++++ gemfiles/3.3 | 5 ++ gemfiles/3.3.lock | 187 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 392 insertions(+), 2 deletions(-) create mode 100644 gemfiles/3.2 create mode 100644 gemfiles/3.2.lock create mode 100644 gemfiles/3.3 create mode 100644 gemfiles/3.3.lock diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index c758c78..221454e 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.4) + rspec-steps (1.0.7) rspec (>= 3.0, < 3.99) GEM @@ -154,3 +154,6 @@ DEPENDENCIES metric_fu (~> 4.11.1) rspec (~> 3.0.0) rspec-steps! + +BUNDLED WITH + 1.10.6 diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index c9d6722..38c8bce 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.4) + rspec-steps (1.0.7) rspec (>= 3.0, < 3.99) GEM @@ -154,3 +154,6 @@ DEPENDENCIES metric_fu (~> 4.11.1) rspec (~> 3.1.0) rspec-steps! + +BUNDLED WITH + 1.10.6 diff --git a/gemfiles/3.2 b/gemfiles/3.2 new file mode 100644 index 0000000..fb24064 --- /dev/null +++ b/gemfiles/3.2 @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "rspec", "~> 3.2.0" + +gemspec :path => ".." diff --git a/gemfiles/3.2.lock b/gemfiles/3.2.lock new file mode 100644 index 0000000..87fef3b --- /dev/null +++ b/gemfiles/3.2.lock @@ -0,0 +1,187 @@ +PATH + remote: .. + specs: + rspec-steps (1.0.7) + rspec (>= 3.0, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + abstract_type (0.0.7) + activesupport (4.2.4) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) + addressable (2.3.8) + arrayfields (4.9.2) + ast (2.1.0) + calibrate (0.0.1) + caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + corundum (0.6.0) + bundler + caliph (~> 0.3) + mattock (~> 0.9) + paint (~> 0.8.7) + rspec (>= 2.0) + simplecov (>= 0.5.4) + simplecov-json (>= 0.2) + diff-lcs (1.2.5) + docile (1.1.5) + domain_name (0.5.24) + unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.11) + erubis (2.7.0) + fattr (2.2.2) + flay (2.6.1) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.2) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.3) + http-cookie (1.0.2) + domain_name (~> 0.5) + i18n (0.7.0) + ice_nine (0.11.1) + json (1.8.3) + json_pure (1.8.2) + launchy (2.4.3) + addressable (~> 2.3) + main (6.1.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.5) + mattock (0.10.0) + calibrate (~> 0.0.1) + caliph (~> 0.3.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + metric_fu (4.11.4) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.6.1) + minitest (5.8.0) + multi_json (1.11.2) + netrc (0.10.3) + paint (0.8.7) + parallel (1.6.1) + parser (2.2.2.6) + ast (>= 1.1, < 3.0) + procto (0.0.2) + rails_best_practices (1.15.7) + activesupport + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) + rake (10.4.2) + redcard (1.1.0) + reek (1.6.6) + parser (~> 2.2.0.pre.7) + rainbow (>= 1.99, < 3.0) + unparser (~> 0.2.2) + require_all (1.3.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) + rspec (3.2.0) + rspec-core (~> 3.2.0) + rspec-expectations (~> 3.2.0) + rspec-mocks (~> 3.2.0) + rspec-core (3.2.3) + rspec-support (~> 3.2.0) + rspec-expectations (3.2.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.2.0) + rspec-mocks (3.2.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.2.0) + rspec-support (3.2.2) + ruby-progressbar (1.7.5) + ruby_parser (3.7.1) + sexp_processor (~> 4.1) + sexp_processor (4.6.0) + simplecov (0.10.0) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + simplecov-json (0.2) + json + simplecov + thread_safe (0.3.5) + tilt (2.0.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) + unparser (0.2.4) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.2.2) + procto (~> 0.0.2) + valise (1.1.4) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (>= 0.4.0) + metric_fu (~> 4.11.1) + rspec (~> 3.2.0) + rspec-steps! + +BUNDLED WITH + 1.10.6 diff --git a/gemfiles/3.3 b/gemfiles/3.3 new file mode 100644 index 0000000..f4d934b --- /dev/null +++ b/gemfiles/3.3 @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "rspec", "~> 3.3.0" + +gemspec :path => ".." diff --git a/gemfiles/3.3.lock b/gemfiles/3.3.lock new file mode 100644 index 0000000..7e03e92 --- /dev/null +++ b/gemfiles/3.3.lock @@ -0,0 +1,187 @@ +PATH + remote: .. + specs: + rspec-steps (1.0.7) + rspec (>= 3.0, < 3.99) + +GEM + remote: https://rubygems.org/ + specs: + abstract_type (0.0.7) + activesupport (4.2.4) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) + addressable (2.3.8) + arrayfields (4.9.2) + ast (2.1.0) + calibrate (0.0.1) + caliph (0.3.1) + cane (2.6.2) + parallel + chronic (0.10.2) + churn (0.0.35) + chronic (>= 0.2.3) + hirb + json_pure + main + rest-client (>= 1.6.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.1) + code_analyzer (0.4.5) + sexp_processor + code_metrics (0.1.3) + coderay (1.1.0) + colored (1.2) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + corundum (0.6.0) + bundler + caliph (~> 0.3) + mattock (~> 0.9) + paint (~> 0.8.7) + rspec (>= 2.0) + simplecov (>= 0.5.4) + simplecov-json (>= 0.2) + diff-lcs (1.2.5) + docile (1.1.5) + domain_name (0.5.24) + unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.11) + erubis (2.7.0) + fattr (2.2.2) + flay (2.6.1) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.3.2) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + hirb (0.7.3) + http-cookie (1.0.2) + domain_name (~> 0.5) + i18n (0.7.0) + ice_nine (0.11.1) + json (1.8.3) + json_pure (1.8.2) + launchy (2.4.3) + addressable (~> 2.3) + main (6.1.0) + arrayfields (>= 4.7.4) + chronic (>= 0.6.2) + fattr (>= 2.2.0) + map (>= 5.1.0) + map (6.5.5) + mattock (0.10.0) + calibrate (~> 0.0.1) + caliph (~> 0.3.1) + rake (~> 10.0) + tilt (> 0) + valise (~> 1.1.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + metric_fu (4.11.4) + cane (~> 2.5, >= 2.5.2) + churn (~> 0.0.35) + code_metrics (~> 0.1) + coderay + flay (~> 2.1, >= 2.0.1) + flog (~> 4.1, >= 4.1.1) + launchy (~> 2.0) + metric_fu-Saikuro (~> 1.1, >= 1.1.3) + multi_json + rails_best_practices (~> 1.14, >= 1.14.3) + redcard + reek (~> 1.3, >= 1.3.4) + roodi (~> 3.1) + metric_fu-Saikuro (1.1.3) + mime-types (2.6.1) + minitest (5.8.0) + multi_json (1.11.2) + netrc (0.10.3) + paint (0.8.7) + parallel (1.6.1) + parser (2.2.2.6) + ast (>= 1.1, < 3.0) + procto (0.0.2) + rails_best_practices (1.15.7) + activesupport + code_analyzer (>= 0.4.3) + colored + erubis + i18n + json + require_all + ruby-progressbar + rainbow (2.0.0) + rake (10.4.2) + redcard (1.1.0) + reek (1.6.6) + parser (~> 2.2.0.pre.7) + rainbow (>= 1.99, < 3.0) + unparser (~> 0.2.2) + require_all (1.3.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + roodi (3.3.1) + ruby_parser (~> 3.2, >= 3.2.2) + rspec (3.3.0) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) + rspec-core (3.3.2) + rspec-support (~> 3.3.0) + rspec-expectations (3.3.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-mocks (3.3.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-support (3.3.0) + ruby-progressbar (1.7.5) + ruby_parser (3.7.1) + sexp_processor (~> 4.1) + sexp_processor (4.6.0) + simplecov (0.10.0) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + simplecov-json (0.2) + json + simplecov + thread_safe (0.3.5) + tilt (2.0.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) + unparser (0.2.4) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.2.2) + procto (~> 0.0.2) + valise (1.1.4) + +PLATFORMS + ruby + +DEPENDENCIES + corundum (>= 0.4.0) + metric_fu (~> 4.11.1) + rspec (~> 3.3.0) + rspec-steps! + +BUNDLED WITH + 1.10.6 From c4ecbada0dbb6a85bdf46c81f76ae7cf8caa7ddd Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:33:49 -0700 Subject: [PATCH 108/127] Version bumpage --- Gemfile.lock | 5 ++++- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- gemfiles/3.2.lock | 2 +- gemfiles/3.3.lock | 2 +- rspec-steps.gemspec | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cf23951..de2eb6f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.0.7) + rspec-steps (1.1.0) rspec (>= 3.0, < 3.99) GEM @@ -157,3 +157,6 @@ DEPENDENCIES fuubar metric_fu (~> 4.11.1) rspec-steps! + +BUNDLED WITH + 1.10.6 diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 221454e..36de75a 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.7) + rspec-steps (1.1.0) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 38c8bce..1198920 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.7) + rspec-steps (1.1.0) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.2.lock b/gemfiles/3.2.lock index 87fef3b..3006545 100644 --- a/gemfiles/3.2.lock +++ b/gemfiles/3.2.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.7) + rspec-steps (1.1.0) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.3.lock b/gemfiles/3.3.lock index 7e03e92..fe0dabe 100644 --- a/gemfiles/3.3.lock +++ b/gemfiles/3.3.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.0.7) + rspec-steps (1.1.0) rspec (>= 3.0, < 3.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 04bda41..afb99e4 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.0.7" + spec.version = "1.1.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From 9bed82856154967ce71e3a501d50e67a95bf853a Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:36:48 -0700 Subject: [PATCH 109/127] Gemspec, updating coverage threshold --- Rakefile | 2 +- lib/rspec-steps/object-extensions.rb | 18 -- lib/rspec-steps/stepwise.rb | 273 --------------------------- rspec-steps.gemspec | 15 +- 4 files changed, 10 insertions(+), 298 deletions(-) delete mode 100644 lib/rspec-steps/object-extensions.rb delete mode 100644 lib/rspec-steps/stepwise.rb diff --git a/Rakefile b/Rakefile index 6e8ca9a..f5f67d1 100644 --- a/Rakefile +++ b/Rakefile @@ -20,7 +20,7 @@ module Corundum rspec.files_to_run = "spec" end SimpleCov.new(tk, rspec) do |cov| - cov.threshold = 74 + cov.threshold = 93 end gem = GemBuilding.new(tk) GemCutter.new(tk,gem) diff --git a/lib/rspec-steps/object-extensions.rb b/lib/rspec-steps/object-extensions.rb deleted file mode 100644 index a9032e9..0000000 --- a/lib/rspec-steps/object-extensions.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'rspec-steps/duckpunch/example-group' -require 'rspec-steps/stepwise' -require 'rspec/core/shared_example_group' - -module RSpec::Core::SharedExampleGroup - alias shared_steps shared_examples - if respond_to? :share_as - alias steps_shared_as share_as - end -end - -[self, RSpec].each do |thing| - if thing.respond_to? :shared_examples and not thing.respond_to? :shared_steps - thing.instance_exec do - alias shared_steps shared_examples - end - end -end diff --git a/lib/rspec-steps/stepwise.rb b/lib/rspec-steps/stepwise.rb deleted file mode 100644 index 1686a9a..0000000 --- a/lib/rspec-steps/stepwise.rb +++ /dev/null @@ -1,273 +0,0 @@ -module RSpecStepwise - class ApatheticReporter < ::RSpec::Core::Reporter - def initialize - @examples = [] - @failed_examples = [] - @pending_examples = [] - @duration = @start = @load_time = nil - end - - #def notify(*args) - #noop - #end - end - - class WholeListExample < RSpec::Core::Example - def initialize(example_group_class, reporter, descriptions, metadata) - super(example_group_class, descriptions, metadata) - #@reporter = ApatheticReporter.new - @reporter = reporter - build_example_block - end - - def start(reporter) - super(@reporter) - end - - def finish(reporter) - super(@reporter) - end - - def build_example_block - #variables of concern: reporter, instance - reporter = @reporter - whole_list = self - @example_block = proc do - begin - self.class.filtered_examples.inject(true) do |success, example| - if RSpec.respond_to? :wants_to_quit - break if RSpec.wants_to_quit - else - break if RSpec.world.wants_to_quit - end - example.extend StepExample - unless success - example.metadata[:skip] = "Previous step failed" - RSpec::Core::Pending.mark_pending!(example, example.skip) - end - succeeded = with_indelible_ivars do - example.run(self, reporter) - end - unless example.exception.nil? - whole_list.set_exception(example.exception) - end - - if self.class.fail_fast? && !succeeded - if RSpec.respond_to? :wants_to_quit= - RSpec.wants_to_quit = true - else - RSpec.world.wants_to_quit = true - end - end - success && succeeded - end - end - end - end - end - - module StepExample - def run_before_each - @example_group_class.run_before_step(self) - rescue Object => ex - puts "\n#{__FILE__}:#{__LINE__} => #{[ex, ex.backtrace].pretty_inspect}" - end - alias run_before_example run_before_each - - def run_after_each - @example_group_class.run_after_step(self) - end - alias run_after_example run_after_each - - def with_around_hooks - yield - end - end - - def self.warnings - @warnings ||= Hash.new do |h,warning| - puts warning #should be warn, but RSpec complains - h[warning] = true - end - end - - module ClassMethods - #This is hacky and needs a more general solution - #Something like cloning the current conf and having RSpec::Stepwise::config ? - def suspend_transactional_fixtures - if self.respond_to? :use_transactional_fixtures - begin - old_val = self.use_transactional_fixtures - self.use_transactional_fixtures = false - - yield - ensure - self.use_transactional_fixtures = old_val - end - else - yield - end - end - - def build_before_hook(options, &block) - if defined? RSpec::Core::Hooks::BeforeHookExtension - block.extend(RSpec::Core::Hooks::BeforeHookExtension).with(options) - else - RSpec::Core::Hooks::BeforeHook.new(block, options) - end - end - - def build_after_hook(options, &block) - if defined? RSpec::Core::Hooks::AfterHookExtension - block.extend(RSpec::Core::Hooks::AfterHookExtension).with(options) - else - RSpec::Core::Hooks::AfterHook.new(block, options) - end - end - - def _metadata_from_args(args) - if RSpec::Core::Metadata.respond_to?(:build_hash_from) - RSpec::Core::Metadata.build_hash_from(args) - else - build_metadata_hash_from(args) - end - end - - def warn_about_promotion(scope_name) - RSpecStepwise.warnings[ - "#{scope_name} :each blocks declared for steps are always treated as " + - ":all scope (it's possible you want #{scope_name} :step)"] - end - - def before(*args, &block) - if args.first == :step - args.shift - options = _metadata_from_args(args) - return ((hooks[:before][:step] ||= []) << build_before_hook(options, &block)) - end - if args.first == :each - warn_about_promotion("before") - end - super - end - - def after(*args, &block) - if args.first == :step - args.shift - options = _metadata_from_args(args) - hooks[:after][:step] ||= [] - return (hooks[:after][:step].unshift build_after_hook(options, &block)) - end - if args.first == :each - warn_about_promotion("after") - end - super - end - - def around(*args, &block) - if args.first == :each - warn_about_promotion("around") - end - super - end - - def example_synonym(named, desc=nil, *args, &block) - unless desc.nil? - desc = [named, desc].join(" ") - end - it(desc, *args, &block) - end - - def when(*args, &block); example_synonym("when", *args, &block); end - def then(*args, &block); example_synonym("then", *args, &block); end - def next(*args, &block); example_synonym("next", *args, &block); end - def step(*args, &block); example_synonym("step", *args, &block); end - - def run_step(example, hook, &sorting) - groups = if respond_to?(:parent_groups) - parent_groups - else - ancestors - end - - if block_given? - groups = yield groups - end - - RSpec::Core::Hooks::HookCollection.new(groups.map {|a| a.hooks[hook][:step]}.flatten.compact).for(example).run - end - - def run_before_step(example) - run_step(example, :before) - end - - def run_after_step(example) - run_step(example, :after) do |groups| - groups.reverse - end - end - - def perform_steps(name, *args, &customization_block) - shared_block = nil - if respond_to?(:world) and world.respond_to? :shared_example_groups - shared_block = world.shared_example_groups[name] - else - if respond_to?(:shared_example_groups) - shared_block = shared_example_groups[name] - else - shared_block = RSpec.world.shared_example_group_registry.find(parent_groups, name) - end - end - raise "Could not find shared example group named #{name.inspect}" unless shared_block - - if respond_to? :module_exec - module_exec(*args, &shared_block) - module_exec(&customization_block) if customization_block - else - module_eval_with_args(*args, &shared_block) - module_eval(&customization_block) if customization_block - end - end - - def run_examples(reporter) - whole_list_example = WholeListExample.new(self, reporter, "step list", {}) - - instance = new - if respond_to? :before_context_ivars - set_ivars(instance, before_context_ivars) - else - set_ivars(instance, before_all_ivars) - end - instance.example = whole_list_example if respond_to? :example= - instance.reporter = reporter if respond_to? :reporter= - - result = suspend_transactional_fixtures do - whole_list_example.run(instance, reporter) - end - - result - end - end - - attr_accessor :reporter - - def with_indelible_ivars - old_value, @ivars_indelible = @ivars_indelible, true - result = yield - @ivars_indelible = old_value - result - rescue Object - @ivars_indelible = old_value - raise - end - - def instance_variable_set(name, value) - if !@ivars_indelible - super - end - end - - def self.included(base) - base.extend(ClassMethods) - end -end diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index afb99e4..bf36ce2 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -20,14 +20,17 @@ Gem::Specification.new do |spec| spec.required_rubygems_version = Gem::Requirement.new(">= 0") if spec.respond_to? :required_rubygems_version= - # Do this: d$@" spec.files = %w[ lib/rspec-steps.rb - lib/rspec-steps/stepwise.rb - lib/rspec-steps/duckpunch/example-group.rb - lib/rspec-steps/duckpunch/example.rb - lib/rspec-steps/duckpunch/hooks.rb - lib/rspec-steps/duckpunch/object-extensions.rb + + lib/rspec-steps + lib/rspec-steps/step-list.rb + lib/rspec-steps/describer.rb + lib/rspec-steps/step.rb + lib/rspec-steps/dsl.rb + lib/rspec-steps/builder.rb + lib/rspec-steps/hook.rb + lib/rspec-steps/step-result.rb doc/README doc/Specifications spec/example_group_spec.rb From e19d7f115e68d9fbeb45bdc5713ee60ba4eff265 Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:39:54 -0700 Subject: [PATCH 110/127] Updating travis.yml --- .travis.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e43172..af4d69a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,33 @@ +sudo: false language: ruby script: bundle exec rake ci -install: .travis-support/cached-bundle install --deployment matrix: include: - gemfile: gemfiles/3.0 rvm: 1.9.3 - gemfile: gemfiles/3.1 rvm: 1.9.3 + - gemfile: gemfiles/3.2 + rvm: 1.9.3 + - gemfile: gemfiles/3.3 + rvm: 1.9.3 - gemfile: gemfiles/3.0 rvm: 2.0.0 - gemfile: gemfiles/3.1 rvm: 2.0.0 + - gemfile: gemfiles/3.2 + rvm: 2.0.0 + - gemfile: gemfiles/3.3 + rvm: 2.0.0 - gemfile: gemfiles/3.0 rvm: 2.1.2 - gemfile: gemfiles/3.1 rvm: 2.1.2 -env: - global: - - CUSTOM_BUNDLE_PATH=gemfiles/vendor/bundle AMAZON_S3_BUCKET=lrd-travis-caching - - secure: b+5Ei+klIudmG+mWu2y6EgHZ/1GxOYX65jGskmQm85lahFUn9jVUn4IhDbERTmBGjjovZvAZ1cIzZg7hhOH2WRcWJX5My13KZv3hurz2jWeziIQp2LtURi7Ghah/1py+82oFTTQe/18A+ONGN7tksqAlWen/UOmfZzXpNPnyF9s= - - secure: FxV30BIED4dP/GkBGF8gtoWirzDzT0Gzn0GxocREp0BZAY9ti5YYoDQixPVCvtQCIKPUjUHnNd8KXdn0HtUhlgLhg7lEE03MoupsXoMZk8gNBeffcCRkzrpVBTmLEhdnoV3UNKpfn2+qCUSqqJimTarDe6k/7F5FzOl3R+xJgxw= + - gemfile: gemfiles/3.2 + rvm: 2.1.2 + - gemfile: gemfiles/3.3 + rvm: 2.1.2 From e7d680c55971e6896e04a25e32b3bbe7ddb0f697 Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 16:43:13 -0700 Subject: [PATCH 111/127] Adding flowdock notifications --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index af4d69a..9b69b63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,3 +31,7 @@ matrix: rvm: 2.1.2 - gemfile: gemfiles/3.3 rvm: 2.1.2 + +notifications: + flowdock: + secure: "iri0YRV17TZXSZ4IDGHd1e1k52u/Kz9EAqP4oGO1wI1OkIvD5t+2RvkSRoRNpQ080kzkjrlIQwpMaLMgUC9Y8TZ11JEq+uujmotRwOJIFtyAIbBwh3enQlOyPRU9kzdlmBHYtd7nLA92dd0PGfhoti2RkqUtqzgWAlZjqg/52zs=" From 395801e5f09277d54b63c3370924d9871e36c976 Mon Sep 17 00:00:00 2001 From: Judson Date: Thu, 27 Aug 2015 17:01:39 -0700 Subject: [PATCH 112/127] Updating sandbox to work with more rspecs --- .gitignore | 1 + Gemfile | 1 + Gemfile.lock | 25 +++++++++++++------------ spec/example_group_spec.rb | 2 +- spec_help/rspec-sandbox.rb | 3 +-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 0f36e89..2be859a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ corundum/ .yardoc/ gh-pages/ tmp/ +spec/examples.txt diff --git a/Gemfile b/Gemfile index b4c4f6a..972489f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source "https://rubygems.org" gem 'fuubar' +gem 'rspec', "~> 3.0.0" gemspec diff --git a/Gemfile.lock b/Gemfile.lock index de2eb6f..51e968f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,19 +116,19 @@ GEM netrc (~> 0.7) roodi (3.3.1) ruby_parser (~> 3.2, >= 3.2.2) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) + rspec (3.0.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-core (3.0.4) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.4) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-support (3.1.2) - ruby-progressbar (1.7.0) + rspec-support (~> 3.0.0) + rspec-mocks (3.0.4) + rspec-support (~> 3.0.0) + rspec-support (3.0.4) + ruby-progressbar (1.7.5) ruby2ruby (2.1.1) ruby_parser (~> 3.1) sexp_processor (~> 4.0) @@ -156,6 +156,7 @@ DEPENDENCIES corundum (>= 0.4.0) fuubar metric_fu (~> 4.11.1) + rspec (~> 3.0.0) rspec-steps! BUNDLED WITH diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index 3a8337f..827ead3 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -149,7 +149,7 @@ end end end - }.to raise_error + }.to raise_error(NoMethodError) end end end diff --git a/spec_help/rspec-sandbox.rb b/spec_help/rspec-sandbox.rb index 86ca014..2490e85 100644 --- a/spec_help/rspec-sandbox.rb +++ b/spec_help/rspec-sandbox.rb @@ -24,8 +24,7 @@ def sandboxed(&block) @orig_example = RSpec.current_example new_config = RSpec::Core::Configuration.new new_config.expose_dsl_globally = false - new_config.expecting_with_rspec = true - #new_config.include(RSpecStepwise, :stepwise => true) + #new_config.expecting_with_rspec = true rescue nil new_world = RSpec::Core::World.new(new_config) RSpec.configuration = new_config RSpec.world = new_world From c2b49f766405450f357ae6f4c57bd8be649bc938 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 16 Sep 2015 16:50:28 -0700 Subject: [PATCH 113/127] Fixes related to let blocks --- .gitignore | 3 + .simplecov | 4 +- Gemfile | 1 + Gemfile.lock | 115 +++++++++++++++++++----------- lib/rspec-steps/builder.rb | 16 +++-- lib/rspec-steps/describer.rb | 55 ++++++++++++-- lib/rspec-steps/dsl.rb | 2 +- lib/rspec-steps/monkeypatching.rb | 3 + lib/rspec-steps/step-list.rb | 27 +++++++ lib/rspec-steps/step.rb | 12 ++-- spec/example_group_spec.rb | 18 +++++ spec_help/spec_helper.rb | 5 ++ 12 files changed, 200 insertions(+), 61 deletions(-) create mode 100644 lib/rspec-steps/monkeypatching.rb diff --git a/.gitignore b/.gitignore index 2be859a..fd8726b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ corundum/ gh-pages/ tmp/ spec/examples.txt +.cadre/ +errors.err +spec_help/cadre.rb diff --git a/.simplecov b/.simplecov index 2de77b1..9a46f70 100644 --- a/.simplecov +++ b/.simplecov @@ -1,4 +1,5 @@ require 'simplecov-json' +require 'cadre/simplecov' SimpleCov.start do coverage_dir "corundum/docs/coverage" @@ -6,6 +7,7 @@ SimpleCov.start do add_filter "vendor/bundle" formatter SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::JSONFormatter + SimpleCov::Formatter::JSONFormatter, + Cadre::SimpleCov::VimFormatter ] end diff --git a/Gemfile b/Gemfile index 972489f..063e86f 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,6 @@ source "https://rubygems.org" gem 'fuubar' gem 'rspec', "~> 3.0.0" +gem 'cadre' gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 51e968f..76e71e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,15 +7,24 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (4.1.5) - i18n (~> 0.6, >= 0.6.9) + abstract_type (0.0.7) + activesupport (4.2.4) + i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) - thread_safe (~> 0.1) + thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.3.6) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) + addressable (2.3.8) arrayfields (4.9.2) - awesome_print (1.2.0) + ast (2.1.0) + cadre (1.0.1) + thor (>= 0.14, < 1.0) + tilt (> 1.0) + valise (~> 1.1.2) + calibrate (0.0.1) caliph (0.3.1) cane (2.6.2) parallel @@ -33,7 +42,10 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.1) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + corundum (0.6.0) bundler caliph (~> 0.3) mattock (~> 0.9) @@ -43,35 +55,44 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) + domain_name (0.5.24) + unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.11) erubis (2.7.0) fattr (2.2.2) - flay (2.5.0) + flay (2.6.1) ruby_parser (~> 3.0) sexp_processor (~> 4.0) - flog (4.3.0) + flog (4.3.2) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.4) fuubar (2.0.0) rspec (~> 3.0) ruby-progressbar (~> 1.4) - hirb (0.7.2) - i18n (0.6.11) - json (1.8.1) - json_pure (1.8.1) - launchy (2.4.2) + hirb (0.7.3) + http-cookie (1.0.2) + domain_name (~> 0.5) + i18n (0.7.0) + ice_nine (0.11.1) + json (1.8.3) + json_pure (1.8.2) + launchy (2.4.3) addressable (~> 2.3) - main (6.0.0) + main (6.1.0) arrayfields (>= 4.7.4) chronic (>= 0.6.2) fattr (>= 2.2.0) map (>= 5.1.0) - map (6.5.4) - mattock (0.9.0) + map (6.5.5) + mattock (0.10.0) + calibrate (~> 0.0.1) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - metric_fu (4.11.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + metric_fu (4.11.4) cane (~> 2.5, >= 2.5.2) churn (~> 0.0.35) code_metrics (~> 0.1) @@ -86,15 +107,17 @@ GEM reek (~> 1.3, >= 1.3.4) roodi (~> 3.1) metric_fu-Saikuro (1.1.3) - mime-types (2.3) - minitest (5.4.0) - multi_json (1.10.1) - netrc (0.7.7) + mime-types (2.6.2) + minitest (5.8.0) + multi_json (1.11.2) + netrc (0.10.3) paint (0.8.7) - parallel (1.2.4) - rails_best_practices (1.15.4) + parallel (1.6.1) + parser (2.2.2.6) + ast (>= 1.1, < 3.0) + procto (0.0.2) + rails_best_practices (1.15.7) activesupport - awesome_print code_analyzer (>= 0.4.3) colored erubis @@ -103,15 +126,15 @@ GEM require_all ruby-progressbar rainbow (2.0.0) - rake (10.3.2) + rake (10.4.2) redcard (1.1.0) - reek (1.3.8) + reek (1.6.6) + parser (~> 2.2.0.pre.7) rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor + unparser (~> 0.2.2) require_all (1.3.2) - rest-client (1.7.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) roodi (3.3.1) @@ -129,30 +152,40 @@ GEM rspec-support (~> 3.0.0) rspec-support (3.0.4) ruby-progressbar (1.7.5) - ruby2ruby (2.1.1) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.6.2) + ruby_parser (3.7.1) sexp_processor (~> 4.1) - sexp_processor (4.4.4) - simplecov (0.9.0) + sexp_processor (4.6.0) + simplecov (0.10.0) docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) simplecov-json (0.2) json simplecov - thread_safe (0.3.4) + thor (0.19.1) + thread_safe (0.3.5) tilt (2.0.1) tzinfo (1.2.2) thread_safe (~> 0.1) - valise (1.1.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) + unparser (0.2.4) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.2.2) + procto (~> 0.0.2) + valise (1.1.4) PLATFORMS ruby DEPENDENCIES + cadre corundum (>= 0.4.0) fuubar metric_fu (~> 4.11.1) diff --git a/lib/rspec-steps/builder.rb b/lib/rspec-steps/builder.rb index 05796cf..17b015b 100644 --- a/lib/rspec-steps/builder.rb +++ b/lib/rspec-steps/builder.rb @@ -3,17 +3,19 @@ class Builder def initialize(describer) @describer = describer end - attr_reader :describer def build_example_group - step_list = describer.step_list - hook_list = describer.hooks - RSpec.describe(*describer.group_args) do - hook_list.each do |hook| + describer = @describer + + RSpec.describe(*describer.group_args, describer.metadata) do + describer.let_list.each do |letter| + letter.define_on(describer.step_list, self) + end + describer.hooks.each do |hook| hook.define_on(self) end - step_list.each do |step| - step.define_on(step_list, self) + describer.step_list.each do |step| + step.define_on(describer.step_list, self) end end end diff --git a/lib/rspec-steps/describer.rb b/lib/rspec-steps/describer.rb index 47e1920..1cde441 100644 --- a/lib/rspec-steps/describer.rb +++ b/lib/rspec-steps/describer.rb @@ -4,17 +4,52 @@ require 'rspec-steps/step-list' module RSpec::Steps + + class Let < Struct.new(:name, :block) + def define_on(step_list, group) + name = self.name + step_list.add_let(name, block) + + group.let(name) do + step_list.let_memo(name, self) + end + end + end + + class LetBang < Let + def define_on(step_list, group) + super + + step_list.add_let_bang(name) + end + end + class Describer - def initialize(*args, &block) + def initialize(args, metadata, &block) @group_args = args + @metadata = {} + if @group_args.last.is_a? Hash + @metadata = @group_args.pop + end + @metadata = metadata.merge(@metadata) @step_list = StepList.new @hooks = [] + @let_list = [] instance_eval(&block) end - attr_reader :group_args, :step_list, :hooks + attr_reader :group_args, :let_list, :step_list, :hooks, :metadata def step(*args, &action) - @step_list << Step.new(*args, &action) + metadata = {} + if args.last.is_a? Hash + metadata = args.pop + end + + metadata = { + :caller => caller + }.merge(metadata) + + @step_list << Step.new(metadata, args, action) end alias when step alias then step @@ -25,7 +60,7 @@ def shared_steps(*args, &block) name = args.first raise "shared step lists need a String for a name" unless name.is_a? String raise "there is already a step list named #{name}" if SharedSteps.has_key?(name) - SharedSteps[name] = Describer.new(*args, &block) + SharedSteps[name] = Describer.new(args, {:caller => caller}, &block) end def perform_steps(name) @@ -34,6 +69,18 @@ def perform_steps(name) @step_list += describer.step_list end + def let(name, &block) + @let_list << Let.new(name, block) + end + + def let!(name, &block) + @let_list << LetBang.new(name, block) + end + + def skip(*args) + #noop + end + def before(kind = :all, &callback) @hooks << Hook.new(:before, kind, callback) end diff --git a/lib/rspec-steps/dsl.rb b/lib/rspec-steps/dsl.rb index d7fff2d..d952301 100644 --- a/lib/rspec-steps/dsl.rb +++ b/lib/rspec-steps/dsl.rb @@ -13,7 +13,7 @@ def self.warnings module DSL def steps(*args, &block) - describer = Describer.new(*args, &block) + describer = Describer.new(args, {:caller => caller}, &block) builder = Builder.new(describer) builder.build_example_group diff --git a/lib/rspec-steps/monkeypatching.rb b/lib/rspec-steps/monkeypatching.rb new file mode 100644 index 0000000..726a95a --- /dev/null +++ b/lib/rspec-steps/monkeypatching.rb @@ -0,0 +1,3 @@ +require 'rspec-steps/dsl' + +extend RSpec::Steps::DSL diff --git a/lib/rspec-steps/step-list.rb b/lib/rspec-steps/step-list.rb index f47525c..ba0524f 100644 --- a/lib/rspec-steps/step-list.rb +++ b/lib/rspec-steps/step-list.rb @@ -6,10 +6,33 @@ class StepList def initialize @steps = [] + @let_bangs = [] + @let_blocks = {} + @let_memos = Hash.new do |h,example| + h[example] = Hash.new do |h, let_name| + h[let_name] = example.instance_eval(&@let_blocks.fetch(let_name)) + end + end @results = nil end attr_accessor :steps + def add_let(name, block) + @let_blocks[name] = block + end + + # In this case, we scope the caching of a let block to an + # example - which since the whole step list runs in a single example is + # fine. It would be more correct to build a result-set and cache lets + # there. + def let_memo(name, example) + @let_memos[example][name] + end + + def add_let_bang(name) + @let_bangs << name + end + def add(step) @steps << step end @@ -32,6 +55,10 @@ def result_for(step) def run_only_once(context_example) return unless @results.nil? failed_step = nil + @let_bangs.each do |let_name| + context_example.__send__(let_name) + end + @results = Hash[ @steps.map do |step| [ step, diff --git a/lib/rspec-steps/step.rb b/lib/rspec-steps/step.rb index 8cf57c9..ed7f31d 100644 --- a/lib/rspec-steps/step.rb +++ b/lib/rspec-steps/step.rb @@ -1,17 +1,15 @@ module RSpec::Steps - class Step - def initialize(*args, &action) - @args = args - @action = action + class Step < Struct.new(:metadata, :args, :action) + def initialize(*whatever) + super @failed_step = nil end - attr_reader :args, :action attr_accessor :failed_step def define_on(step_list, example_group) step = self - example_group.it(*args) do |in_context| - step_list.run_only_once(in_context) + example_group.it(*args, metadata) do |example| + step_list.run_only_once(self) result = step_list.result_for(step) pending if result.is_after_failed_step? expect(result).to have_executed_successfully diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index 827ead3..3c23ab4 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -18,6 +18,24 @@ end end + it "should define let blocks correctly" do + group = nil + sandboxed do + group = RSpec.steps "Test Steps" do + let! :array do [] end + let :number do 17 end + it("adds number to array"){ array << number } + it("adds number to array twice"){ array << number } + it("checks array"){ expect(array).to eq([17,17])} + end + group.run + end + + group.examples.each do |example| + expect(example.metadata[:execution_result].status).to eq(:passed) + end + end + it "should work with shared_steps/perform steps" do group = nil sandboxed do diff --git a/spec_help/spec_helper.rb b/spec_help/spec_helper.rb index 88cb728..b858d74 100644 --- a/spec_help/spec_helper.rb +++ b/spec_help/spec_helper.rb @@ -1,3 +1,8 @@ require 'rspec' +begin + require 'cadre' +rescue LoadErr +end + #Ungemmer::ungem_gemspec From 8f585a218178b4461f7b262fe12de5e2d900abbb Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 16 Sep 2015 16:52:00 -0700 Subject: [PATCH 114/127] Major version bump - before :step -> before :each --- Gemfile.lock | 2 +- rspec-steps.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 76e71e3..0a19425 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rspec-steps (1.1.0) + rspec-steps (2.0.0) rspec (>= 3.0, < 3.99) GEM diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index bf36ce2..78a8a10 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "1.1.0" + spec.version = "2.0.0" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" From c389529398cac49a42c3c59845281eb06a51e0a8 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 16 Sep 2015 17:21:40 -0700 Subject: [PATCH 115/127] Updated docs --- doc/README | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/doc/README b/doc/README index 47ef45a..76aadbe 100644 --- a/doc/README +++ b/doc/README @@ -56,8 +56,10 @@ almost all cases. BUT, that complete separation of examples really sucks when you're trying to write long stories involving many requests. You are usually stuck with three choices: -1. Write a sequence of examples, each of which repeats the behavior of all previous examples. Downside: horrendously inefficient. -2. Write a single huge example which performs the entire story. Downside: only one description, no independent reporting of the steps of the story. +1. Write a sequence of examples, each of which repeats the behavior of all + previous examples. Downside: horrendously inefficient. +2. Write a single huge example which performs the entire story. Downside: only + one description, no independent reporting of the steps of the story. 3. Use Cucumber. Downside: We agree totally with this guy: http://bit.ly/dmXqnY RSpec-steps intentionally breaks RSpec's "independent" philosophy to let us get the @@ -66,14 +68,12 @@ and skip subsequent steps after a failure. ## Caveats and cautions -Don't call "describe" inside of "steps". The behavior is undefined and probably bad. It's -hard to imagine what this should actually mean in any case. Future versions of rspec-steps -will consider this an error. +Don't call "describe" inside of "steps". As of 2.0, this is an error. -Any call to "before" inside a steps block is treated like before(:all) and is run only -once before the first step. Or perhaps more accurately, any call to before() is treated -like before(:each) ... but for these purposes the entire steps block is treated like a -single example. +If you're using RSpec-Steps with Rails (for instance, with Capybara), you will +absolutely need to make sure you have transactional fixtures off. Otherwise, +you'll experience problems where the tests and the application appear to see +completely different databases. ## Advanced stuff: shared steps @@ -110,9 +110,13 @@ diverge, you can DRY your code out with shared_steps blocks, like so: ## Versions and Dependencies -The goal (sadly unfulfilled) is to try to be compatible with as many versions -of RSpec 3.x as possible. Frankly, Rspec-Steps is more than a little bit of a -hack, and intrudes wholesale on RSpec's private interfaces. +The goal is to try to be compatible with as many versions +of RSpec 3.x as possible. + +As of version 2.0, we've reverted to the expected behavior of before :all and +before :each. Older versions used a new lifecycle mode called :step, which is +now removed. If you used `rspec-steps` before and wrote `before :step` +anywhere, change it to `before :each` and all will be well. We make good use of Travis to check compatibility, however. You can check what versions of RSpec and Ruby RSpec-Steps works with here: From 69143e5bf907d5275188e28267ea61b61f1c795a Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 16 Sep 2015 17:28:27 -0700 Subject: [PATCH 116/127] Forgot to update the per-rspec gemfiles --- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- gemfiles/3.2.lock | 2 +- gemfiles/3.3.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 36de75a..6f712fb 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.1.0) + rspec-steps (2.0.0) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 1198920..1b32de9 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.1.0) + rspec-steps (2.0.0) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.2.lock b/gemfiles/3.2.lock index 3006545..e5d45dd 100644 --- a/gemfiles/3.2.lock +++ b/gemfiles/3.2.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.1.0) + rspec-steps (2.0.0) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.3.lock b/gemfiles/3.3.lock index fe0dabe..b3d1885 100644 --- a/gemfiles/3.3.lock +++ b/gemfiles/3.3.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (1.1.0) + rspec-steps (2.0.0) rspec (>= 3.0, < 3.99) GEM From 14d119d2b8a36532fa8d2e00c93a131bbe360380 Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 16 Sep 2015 17:32:15 -0700 Subject: [PATCH 117/127] Typo --- spec_help/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec_help/spec_helper.rb b/spec_help/spec_helper.rb index b858d74..fbf90a7 100644 --- a/spec_help/spec_helper.rb +++ b/spec_help/spec_helper.rb @@ -2,7 +2,7 @@ begin require 'cadre' -rescue LoadErr +rescue LoadError end #Ungemmer::ungem_gemspec From 43dea299d959579e60997a1e73e010892f1846bb Mon Sep 17 00:00:00 2001 From: Judson Date: Wed, 16 Sep 2015 17:38:15 -0700 Subject: [PATCH 118/127] Fixin' gemfiles... --- gemfiles/3.0 | 1 + gemfiles/3.0.lock | 119 +++++++++++++++++++++++++++++----------------- gemfiles/3.1 | 1 + gemfiles/3.1.lock | 111 +++++++++++++++++++++++++++--------------- gemfiles/3.2 | 1 + gemfiles/3.2.lock | 8 +++- gemfiles/3.3 | 1 + gemfiles/3.3.lock | 8 +++- 8 files changed, 166 insertions(+), 84 deletions(-) diff --git a/gemfiles/3.0 b/gemfiles/3.0 index 5e3fdb2..4c062c5 100644 --- a/gemfiles/3.0 +++ b/gemfiles/3.0 @@ -1,5 +1,6 @@ source "https://rubygems.org" gem "rspec", "~> 3.0.0" +gem 'cadre' gemspec :path => ".." diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 6f712fb..07d1ced 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -7,15 +7,24 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (4.1.4) - i18n (~> 0.6, >= 0.6.9) + abstract_type (0.0.7) + activesupport (4.2.4) + i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) - thread_safe (~> 0.1) + thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.3.6) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) + addressable (2.3.8) arrayfields (4.9.2) - awesome_print (1.2.0) + ast (2.1.0) + cadre (1.0.1) + thor (>= 0.14, < 1.0) + tilt (> 1.0) + valise (~> 1.1.2) + calibrate (0.0.1) caliph (0.3.1) cane (2.6.2) parallel @@ -33,7 +42,10 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.1) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + corundum (0.6.0) bundler caliph (~> 0.3) mattock (~> 0.9) @@ -43,32 +55,41 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) + domain_name (0.5.24) + unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.11) erubis (2.7.0) fattr (2.2.2) - flay (2.5.0) + flay (2.6.1) ruby_parser (~> 3.0) sexp_processor (~> 4.0) - flog (4.3.0) + flog (4.3.2) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.4) - hirb (0.7.2) - i18n (0.6.11) - json (1.8.1) - json_pure (1.8.1) - launchy (2.4.2) + hirb (0.7.3) + http-cookie (1.0.2) + domain_name (~> 0.5) + i18n (0.7.0) + ice_nine (0.11.1) + json (1.8.3) + json_pure (1.8.2) + launchy (2.4.3) addressable (~> 2.3) - main (6.0.0) + main (6.1.0) arrayfields (>= 4.7.4) chronic (>= 0.6.2) fattr (>= 2.2.0) map (>= 5.1.0) - map (6.5.4) - mattock (0.9.0) + map (6.5.5) + mattock (0.10.0) + calibrate (~> 0.0.1) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - metric_fu (4.11.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + metric_fu (4.11.4) cane (~> 2.5, >= 2.5.2) churn (~> 0.0.35) code_metrics (~> 0.1) @@ -83,15 +104,17 @@ GEM reek (~> 1.3, >= 1.3.4) roodi (~> 3.1) metric_fu-Saikuro (1.1.3) - mime-types (2.3) - minitest (5.4.0) - multi_json (1.10.1) - netrc (0.7.7) + mime-types (2.6.2) + minitest (5.8.0) + multi_json (1.11.2) + netrc (0.10.3) paint (0.8.7) - parallel (1.1.2) - rails_best_practices (1.15.4) + parallel (1.6.1) + parser (2.2.2.6) + ast (>= 1.1, < 3.0) + procto (0.0.2) + rails_best_practices (1.15.7) activesupport - awesome_print code_analyzer (>= 0.4.3) colored erubis @@ -100,15 +123,15 @@ GEM require_all ruby-progressbar rainbow (2.0.0) - rake (10.3.2) + rake (10.4.2) redcard (1.1.0) - reek (1.3.8) + reek (1.6.6) + parser (~> 2.2.0.pre.7) rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor + unparser (~> 0.2.2) require_all (1.3.2) - rest-client (1.7.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) roodi (3.3.1) @@ -125,31 +148,41 @@ GEM rspec-mocks (3.0.4) rspec-support (~> 3.0.0) rspec-support (3.0.4) - ruby-progressbar (1.5.1) - ruby2ruby (2.1.1) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.6.2) + ruby-progressbar (1.7.5) + ruby_parser (3.7.1) sexp_processor (~> 4.1) - sexp_processor (4.4.3) - simplecov (0.9.0) + sexp_processor (4.6.0) + simplecov (0.10.0) docile (~> 1.1.0) - multi_json - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) simplecov-json (0.2) json simplecov - thread_safe (0.3.4) + thor (0.19.1) + thread_safe (0.3.5) tilt (2.0.1) - tzinfo (1.2.1) + tzinfo (1.2.2) thread_safe (~> 0.1) - valise (1.1.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) + unparser (0.2.4) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.2.2) + procto (~> 0.0.2) + valise (1.1.4) PLATFORMS ruby DEPENDENCIES + cadre corundum (>= 0.4.0) metric_fu (~> 4.11.1) rspec (~> 3.0.0) diff --git a/gemfiles/3.1 b/gemfiles/3.1 index 70eabd7..59408f1 100644 --- a/gemfiles/3.1 +++ b/gemfiles/3.1 @@ -1,5 +1,6 @@ source "https://rubygems.org" gem "rspec", "~> 3.1.0" +gem 'cadre' gemspec :path => ".." diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 1b32de9..7604089 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -7,15 +7,24 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (4.1.7) - i18n (~> 0.6, >= 0.6.9) + abstract_type (0.0.7) + activesupport (4.2.4) + i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) - thread_safe (~> 0.1) + thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.3.6) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) + addressable (2.3.8) arrayfields (4.9.2) - awesome_print (1.2.0) + ast (2.1.0) + cadre (1.0.1) + thor (>= 0.14, < 1.0) + tilt (> 1.0) + valise (~> 1.1.2) + calibrate (0.0.1) caliph (0.3.1) cane (2.6.2) parallel @@ -33,7 +42,10 @@ GEM code_metrics (0.1.3) coderay (1.1.0) colored (1.2) - corundum (0.4.1) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + corundum (0.6.0) bundler caliph (~> 0.3) mattock (~> 0.9) @@ -43,18 +55,24 @@ GEM simplecov-json (>= 0.2) diff-lcs (1.2.5) docile (1.1.5) + domain_name (0.5.24) + unf (>= 0.0.5, < 1.0.0) + equalizer (0.0.11) erubis (2.7.0) fattr (2.2.2) - flay (2.5.0) + flay (2.6.1) ruby_parser (~> 3.0) sexp_processor (~> 4.0) - flog (4.3.0) + flog (4.3.2) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.4) - hirb (0.7.2) - i18n (0.6.11) - json (1.8.1) - json_pure (1.8.1) + hirb (0.7.3) + http-cookie (1.0.2) + domain_name (~> 0.5) + i18n (0.7.0) + ice_nine (0.11.1) + json (1.8.3) + json_pure (1.8.2) launchy (2.4.3) addressable (~> 2.3) main (6.1.0) @@ -63,12 +81,15 @@ GEM fattr (>= 2.2.0) map (>= 5.1.0) map (6.5.5) - mattock (0.9.0) + mattock (0.10.0) + calibrate (~> 0.0.1) caliph (~> 0.3.1) rake (~> 10.0) tilt (> 0) valise (~> 1.1.1) - metric_fu (4.11.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + metric_fu (4.11.4) cane (~> 2.5, >= 2.5.2) churn (~> 0.0.35) code_metrics (~> 0.1) @@ -83,15 +104,17 @@ GEM reek (~> 1.3, >= 1.3.4) roodi (~> 3.1) metric_fu-Saikuro (1.1.3) - mime-types (2.4.3) - minitest (5.4.2) - multi_json (1.10.1) - netrc (0.8.0) + mime-types (2.6.2) + minitest (5.8.0) + multi_json (1.11.2) + netrc (0.10.3) paint (0.8.7) - parallel (1.3.3) - rails_best_practices (1.15.4) + parallel (1.6.1) + parser (2.2.2.6) + ast (>= 1.1, < 3.0) + procto (0.0.2) + rails_best_practices (1.15.7) activesupport - awesome_print code_analyzer (>= 0.4.3) colored erubis @@ -100,15 +123,15 @@ GEM require_all ruby-progressbar rainbow (2.0.0) - rake (10.3.2) + rake (10.4.2) redcard (1.1.0) - reek (1.3.8) + reek (1.6.6) + parser (~> 2.2.0.pre.7) rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor + unparser (~> 0.2.2) require_all (1.3.2) - rest-client (1.7.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) roodi (3.3.1) @@ -125,31 +148,41 @@ GEM rspec-mocks (3.1.3) rspec-support (~> 3.1.0) rspec-support (3.1.2) - ruby-progressbar (1.7.0) - ruby2ruby (2.1.3) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.6.3) + ruby-progressbar (1.7.5) + ruby_parser (3.7.1) sexp_processor (~> 4.1) - sexp_processor (4.4.4) - simplecov (0.9.1) + sexp_processor (4.6.0) + simplecov (0.10.0) docile (~> 1.1.0) - multi_json (~> 1.0) - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) simplecov-json (0.2) json simplecov - thread_safe (0.3.4) + thor (0.19.1) + thread_safe (0.3.5) tilt (2.0.1) tzinfo (1.2.2) thread_safe (~> 0.1) - valise (1.1.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.1) + unparser (0.2.4) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.2.2) + procto (~> 0.0.2) + valise (1.1.4) PLATFORMS ruby DEPENDENCIES + cadre corundum (>= 0.4.0) metric_fu (~> 4.11.1) rspec (~> 3.1.0) diff --git a/gemfiles/3.2 b/gemfiles/3.2 index fb24064..14bdc9b 100644 --- a/gemfiles/3.2 +++ b/gemfiles/3.2 @@ -1,5 +1,6 @@ source "https://rubygems.org" gem "rspec", "~> 3.2.0" +gem 'cadre' gemspec :path => ".." diff --git a/gemfiles/3.2.lock b/gemfiles/3.2.lock index e5d45dd..e5b85c7 100644 --- a/gemfiles/3.2.lock +++ b/gemfiles/3.2.lock @@ -20,6 +20,10 @@ GEM addressable (2.3.8) arrayfields (4.9.2) ast (2.1.0) + cadre (1.0.1) + thor (>= 0.14, < 1.0) + tilt (> 1.0) + valise (~> 1.1.2) calibrate (0.0.1) caliph (0.3.1) cane (2.6.2) @@ -100,7 +104,7 @@ GEM reek (~> 1.3, >= 1.3.4) roodi (~> 3.1) metric_fu-Saikuro (1.1.3) - mime-types (2.6.1) + mime-types (2.6.2) minitest (5.8.0) multi_json (1.11.2) netrc (0.10.3) @@ -157,6 +161,7 @@ GEM simplecov-json (0.2) json simplecov + thor (0.19.1) thread_safe (0.3.5) tilt (2.0.1) tzinfo (1.2.2) @@ -178,6 +183,7 @@ PLATFORMS ruby DEPENDENCIES + cadre corundum (>= 0.4.0) metric_fu (~> 4.11.1) rspec (~> 3.2.0) diff --git a/gemfiles/3.3 b/gemfiles/3.3 index f4d934b..028bc33 100644 --- a/gemfiles/3.3 +++ b/gemfiles/3.3 @@ -1,5 +1,6 @@ source "https://rubygems.org" gem "rspec", "~> 3.3.0" +gem 'cadre' gemspec :path => ".." diff --git a/gemfiles/3.3.lock b/gemfiles/3.3.lock index b3d1885..6d1ee57 100644 --- a/gemfiles/3.3.lock +++ b/gemfiles/3.3.lock @@ -20,6 +20,10 @@ GEM addressable (2.3.8) arrayfields (4.9.2) ast (2.1.0) + cadre (1.0.1) + thor (>= 0.14, < 1.0) + tilt (> 1.0) + valise (~> 1.1.2) calibrate (0.0.1) caliph (0.3.1) cane (2.6.2) @@ -100,7 +104,7 @@ GEM reek (~> 1.3, >= 1.3.4) roodi (~> 3.1) metric_fu-Saikuro (1.1.3) - mime-types (2.6.1) + mime-types (2.6.2) minitest (5.8.0) multi_json (1.11.2) netrc (0.10.3) @@ -157,6 +161,7 @@ GEM simplecov-json (0.2) json simplecov + thor (0.19.1) thread_safe (0.3.5) tilt (2.0.1) tzinfo (1.2.2) @@ -178,6 +183,7 @@ PLATFORMS ruby DEPENDENCIES + cadre corundum (>= 0.4.0) metric_fu (~> 4.11.1) rspec (~> 3.3.0) From 31a46d3cebc9cf97f927855022cd206c4964df2a Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 18 Sep 2015 09:48:22 -0700 Subject: [PATCH 119/127] Update to README, file structure. --- doc/README | 10 +++++----- lib/rspec-steps/describer.rb | 20 +------------------- lib/rspec-steps/lets.rb | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 lib/rspec-steps/lets.rb diff --git a/doc/README b/doc/README index 76aadbe..f60dd7b 100644 --- a/doc/README +++ b/doc/README @@ -75,6 +75,11 @@ absolutely need to make sure you have transactional fixtures off. Otherwise, you'll experience problems where the tests and the application appear to see completely different databases. +While Steps 2.0 retains it's shift in lifecycle hooks (:each become :all, +there's a :step hook), this shift *no longer* applies to config.before _et al_ +-- you'll need to use config.before :each to run around each step. This is the +primary change to the Steps interface that called for a major version bump. + ## Advanced stuff: shared steps If you have (for example) two user stories that share the same first N steps but then @@ -113,11 +118,6 @@ diverge, you can DRY your code out with shared_steps blocks, like so: The goal is to try to be compatible with as many versions of RSpec 3.x as possible. -As of version 2.0, we've reverted to the expected behavior of before :all and -before :each. Older versions used a new lifecycle mode called :step, which is -now removed. If you used `rspec-steps` before and wrote `before :step` -anywhere, change it to `before :each` and all will be well. - We make good use of Travis to check compatibility, however. You can check what versions of RSpec and Ruby RSpec-Steps works with here: https://travis-ci.org/LRDesign/rspec-steps diff --git a/lib/rspec-steps/describer.rb b/lib/rspec-steps/describer.rb index 1cde441..f021de2 100644 --- a/lib/rspec-steps/describer.rb +++ b/lib/rspec-steps/describer.rb @@ -2,28 +2,10 @@ require 'rspec-steps/step' require 'rspec-steps/hook' require 'rspec-steps/step-list' +require 'rspec-steps/lets' module RSpec::Steps - class Let < Struct.new(:name, :block) - def define_on(step_list, group) - name = self.name - step_list.add_let(name, block) - - group.let(name) do - step_list.let_memo(name, self) - end - end - end - - class LetBang < Let - def define_on(step_list, group) - super - - step_list.add_let_bang(name) - end - end - class Describer def initialize(args, metadata, &block) @group_args = args diff --git a/lib/rspec-steps/lets.rb b/lib/rspec-steps/lets.rb new file mode 100644 index 0000000..fd73424 --- /dev/null +++ b/lib/rspec-steps/lets.rb @@ -0,0 +1,20 @@ +module RSpec::Steps + class Let < Struct.new(:name, :block) + def define_on(step_list, group) + name = self.name + step_list.add_let(name, block) + + group.let(name) do + step_list.let_memo(name, self) + end + end + end + + class LetBang < Let + def define_on(step_list, group) + super + + step_list.add_let_bang(name) + end + end +end From 7b5bc599301a94b53f77f057c301cfa227443705 Mon Sep 17 00:00:00 2001 From: Judson Date: Fri, 18 Sep 2015 11:47:51 -0700 Subject: [PATCH 120/127] Adding file to gemspec manifest --- rspec-steps.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index 78a8a10..b767459 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -31,6 +31,7 @@ Gem::Specification.new do |spec| lib/rspec-steps/builder.rb lib/rspec-steps/hook.rb lib/rspec-steps/step-result.rb + lib/rspec-steps/lets.rb doc/README doc/Specifications spec/example_group_spec.rb From 51cb9d6cbfb08efe0c7357bff4d7cd515415bee4 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 21 Sep 2015 11:57:22 -0700 Subject: [PATCH 121/127] Little note added to README --- doc/README | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/README b/doc/README index f60dd7b..9384dbc 100644 --- a/doc/README +++ b/doc/README @@ -70,6 +70,14 @@ and skip subsequent steps after a failure. Don't call "describe" inside of "steps". As of 2.0, this is an error. +As of 2.0, Steps no longer automatically adds its DSL to the top level. If you +want that behavior (especially if you're updating an older project) add: + +``` +require 'rspec-steps/monkeypatch' +``` +to e.g. `spec_helper.rb.` + If you're using RSpec-Steps with Rails (for instance, with Capybara), you will absolutely need to make sure you have transactional fixtures off. Otherwise, you'll experience problems where the tests and the application appear to see From df12313129ce67b78776b58aa2786ba5510bbee4 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 21 Sep 2015 11:58:40 -0700 Subject: [PATCH 122/127] Indents --- doc/README | 57 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/doc/README b/doc/README index 9384dbc..0287826 100644 --- a/doc/README +++ b/doc/README @@ -13,33 +13,34 @@ https://github.com/LRDesign/two-step ) One excellent example is web site integration tests. With RSpec steps you can do: - steps "Login and change password" do - it "should show the login form" do - visit root - page.should have_text "Login" - end - - it "should successfully log in" do - fill_in :name, "Johnny User" - click "Login" - page.should have_text "Welcome, Johnny!" - end - - it "should load the password change form" do - click "My Settings" - click "Update Password" - page.should have_selector("form#update_password") - end - - it "should change the user's password successfully" do - fill_in :password, "foobar" - fill_in :password_confirmation, "foobar" - click "Change Password" - page.should have_text "Password changed successfully!" - User.find_by_name("Johnny User").valid_password?("foobar").should be_true - end - - end +```ruby +RSpec::Steps.steps "Login and change password" do + it "should show the login form" do + visit root + page.should have_text "Login" + end + + it "should successfully log in" do + fill_in :name, "Johnny User" + click "Login" + page.should have_text "Welcome, Johnny!" + end + + it "should load the password change form" do + click "My Settings" + click "Update Password" + page.should have_selector("form#update_password") + end + + it "should change the user's password successfully" do + fill_in :password, "foobar" + fill_in :password_confirmation, "foobar" + click "Change Password" + page.should have_text "Password changed successfully!" + User.find_by_name("Johnny User").valid_password?("foobar").should be_true + end +end +``` The examples above will be run in order. State is preserved between examples inside a "steps" block: any DB transactions will not roll back until the entire @@ -74,7 +75,7 @@ As of 2.0, Steps no longer automatically adds its DSL to the top level. If you want that behavior (especially if you're updating an older project) add: ``` -require 'rspec-steps/monkeypatch' +require 'rspec-steps/monkeypatching' ``` to e.g. `spec_helper.rb.` From df2f1c8461dac5b30f0f8e7386aa8e62aff24ea4 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 21 Sep 2015 12:23:17 -0700 Subject: [PATCH 123/127] Manifest fix --- rspec-steps.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index b767459..ca9bcb5 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -23,7 +23,6 @@ Gem::Specification.new do |spec| spec.files = %w[ lib/rspec-steps.rb - lib/rspec-steps lib/rspec-steps/step-list.rb lib/rspec-steps/describer.rb lib/rspec-steps/step.rb From f26420bf10d625d0e3562431dcaeadf00b30630a Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 21 Sep 2015 13:54:57 -0700 Subject: [PATCH 124/127] Missed monkeypatching.rb --- rspec-steps.gemspec | 3 ++- spec/example_group_spec.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index ca9bcb5..f70ae9e 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "rspec-steps" - spec.version = "2.0.0" + spec.version = "2.0.1" author_list = { "Judson Lester" => "judson@lrdesign.com", "Evan Dorn" => "evan@lrdesign.com" @@ -31,6 +31,7 @@ Gem::Specification.new do |spec| lib/rspec-steps/hook.rb lib/rspec-steps/step-result.rb lib/rspec-steps/lets.rb + lib/rspec-steps/monkeypatching.rb doc/README doc/Specifications spec/example_group_spec.rb diff --git a/spec/example_group_spec.rb b/spec/example_group_spec.rb index 3c23ab4..fee2400 100644 --- a/spec/example_group_spec.rb +++ b/spec/example_group_spec.rb @@ -1,5 +1,6 @@ require 'rspec-steps' require 'rspec-sandbox' +require 'rspec-steps/monkeypatching' describe RSpec::Core::ExampleGroup do describe "with Stepwise included" do From adb060bddc677461db97f1e92eddf919cd140924 Mon Sep 17 00:00:00 2001 From: Judson Date: Mon, 21 Sep 2015 14:24:21 -0700 Subject: [PATCH 125/127] Fixing gemfiles for travis --- gemfiles/3.0.lock | 2 +- gemfiles/3.1.lock | 2 +- gemfiles/3.2.lock | 2 +- gemfiles/3.3.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/3.0.lock b/gemfiles/3.0.lock index 07d1ced..217da9b 100644 --- a/gemfiles/3.0.lock +++ b/gemfiles/3.0.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (2.0.0) + rspec-steps (2.0.1) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.1.lock b/gemfiles/3.1.lock index 7604089..2ac81ed 100644 --- a/gemfiles/3.1.lock +++ b/gemfiles/3.1.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (2.0.0) + rspec-steps (2.0.1) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.2.lock b/gemfiles/3.2.lock index e5b85c7..6590793 100644 --- a/gemfiles/3.2.lock +++ b/gemfiles/3.2.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (2.0.0) + rspec-steps (2.0.1) rspec (>= 3.0, < 3.99) GEM diff --git a/gemfiles/3.3.lock b/gemfiles/3.3.lock index 6d1ee57..0cdc254 100644 --- a/gemfiles/3.3.lock +++ b/gemfiles/3.3.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - rspec-steps (2.0.0) + rspec-steps (2.0.1) rspec (>= 3.0, < 3.99) GEM From b8ad524dbad84ff1b9d8c30748cfaaaea2965ed0 Mon Sep 17 00:00:00 2001 From: Judson Date: Tue, 22 Sep 2015 11:22:36 -0700 Subject: [PATCH 126/127] Update to description --- rspec-steps.gemspec | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/rspec-steps.gemspec b/rspec-steps.gemspec index f70ae9e..d98f28c 100644 --- a/rspec-steps.gemspec +++ b/rspec-steps.gemspec @@ -9,10 +9,17 @@ Gem::Specification.new do |spec| spec.email = spec.authors.map {|name| author_list[name]} spec.summary = "I want steps in RSpec" spec.description = <<-EOD - I don't like Cucumber. I don't need plain text stories. My clients either - read code or don't read any test documents, so Cucumber is mostly useless to me. - But often, especially in full integration tests, it would be nice to have - steps in a test. + A minimal implementation of integration testing within RSpec. + Allows you to build sequential specs, each with a description, + but where state is maintained between tests and before/after actions are only + triggered at the beginning and end of the entire sequence. Cool things you + can do with this: + + * Build multi-step user stories in plain RSpec syntax. Locate the point of + failure quickly, and break up large integrations into sensible steps + * Speed up groups of related tests by running your factories only once before + the whole group. + EOD spec.rubyforge_project= spec.name.downcase From fc0b8d71511e51031ecc64afae9d9c949b263899 Mon Sep 17 00:00:00 2001 From: Evan Dorn Date: Sun, 18 Oct 2015 12:40:28 -0700 Subject: [PATCH 127/127] Add required metadata to Describer.new() call in shared_steps --- lib/rspec-steps/dsl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec-steps/dsl.rb b/lib/rspec-steps/dsl.rb index d952301..92cbe04 100644 --- a/lib/rspec-steps/dsl.rb +++ b/lib/rspec-steps/dsl.rb @@ -23,7 +23,7 @@ def shared_steps(*args, &block) name = args.first raise "shared step lists need a String for a name" unless name.is_a? String raise "there is already a step list named #{name}" if SharedSteps.has_key?(name) - SharedSteps[name] = Describer.new(*args, &block) + SharedSteps[name] = Describer.new(*args, {:caller => caller}, &block) end end extend DSL