From fb923baee48d2ab52c2a4065affeefd85e76c1d2 Mon Sep 17 00:00:00 2001 From: Al Snow Date: Sat, 19 Mar 2016 18:33:01 -0400 Subject: [PATCH] Upgraded rspec 2.14.2 to 2.99.0 --- Gemfile | 8 ++- Gemfile.lock | 66 ++++++++++++------- spec/helpers/api/v1/users_helper_spec.rb | 2 +- spec/helpers/password_resets_helper_spec.rb | 2 +- spec/helpers/pay_helper_spec.rb | 2 +- spec/models/benefits_spec.rb | 4 +- spec/models/pay_spec.rb | 2 +- spec/models/user_spec.rb | 10 +-- spec/spec_helper.rb | 11 ++++ .../password_resets/new.html.erb_spec.rb | 2 +- .../vulnerabilities/command_injection_spec.rb | 4 +- spec/vulnerabilities/mass_assignment_spec.rb | 6 +- spec/vulnerabilities/sql_injection_spec.rb | 4 +- 13 files changed, 80 insertions(+), 43 deletions(-) diff --git a/Gemfile b/Gemfile index 2fb0d73..a8b9101 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,14 @@ source 'https://rubygems.org' +gem 'gemdiff' + #don't upgrade gem 'rails', '4.2.6' ruby '2.3.0' +gem 'rake', '10.5.0' # LOCKED DOWN UNTIL MOVE TO RSPEC beta2. + # Bundle edge Rails instead: # gem 'rails', github: 'rails/rails' @@ -39,7 +43,7 @@ group :development, :test, :mysql do gem 'capybara' gem 'database_cleaner' gem 'poltergeist' - gem 'rspec-rails', '2.14.2' + gem 'rspec-rails', '2.99.0' # LOCKED DOWN gem 'test-unit' end @@ -72,7 +76,7 @@ gem 'jquery-rails' # Pow related gem gem 'powder' -gem 'aruba' +gem 'aruba', '0.9.0.pre' # LOCKED DOWN #gem 'minitest', '~> 4.0', :require=> "minitest/autorun" #gem 'minitest' diff --git a/Gemfile.lock b/Gemfile.lock index a3fc947..db7b1a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,10 +38,13 @@ GEM tzinfo (~> 1.1) addressable (2.4.0) arel (6.0.3) - aruba (0.7.4) - childprocess (>= 0.3.6) - cucumber (>= 1.1.1) - rspec-expectations (>= 2.7.0) + aruba (0.9.0.pre) + childprocess (~> 0.5.6) + contracts (~> 0.9) + cucumber (>= 1.3.19) + ffi (~> 1.9.10) + rspec-expectations (>= 2.99) + thor (~> 0.19) bcrypt (3.1.11) better_errors (2.1.1) coderay (>= 1.0.0) @@ -82,8 +85,9 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.1) + contracts (0.13.0) crack (0.3.1) - cucumber (2.3.2) + cucumber (2.3.3) builder (>= 2.1.2) cucumber-core (~> 1.4.0) cucumber-wire (~> 0.0.1) @@ -105,6 +109,8 @@ GEM erubis (2.7.0) eventmachine (1.0.9.1) execjs (2.6.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) ffi (1.9.10) foreman (0.78.0) thor (~> 0.19.1) @@ -114,6 +120,10 @@ GEM cucumber nokogiri trollop + gemdiff (1.0.1) + launchy (~> 2.4) + octokit (~> 4.0) + thor (~> 0.19) gherkin (3.2.0) globalid (0.3.6) activesupport (>= 4.1.0) @@ -135,9 +145,10 @@ GEM guard (~> 2.8) guard-compat (~> 1.0) multi_json (~> 1.8) - guard-rspec (4.3.1) + guard-rspec (4.6.4) guard (~> 2.1) - rspec (>= 2.14, < 4.0) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) guard-shell (0.7.1) guard (>= 2.0.0) guard-compat (~> 1.0) @@ -182,6 +193,7 @@ GEM minitest (5.8.4) multi_json (1.11.2) multi_test (0.1.2) + multipart-post (2.0.0) mysql2 (0.4.3) nenv (0.3.0) nokogiri (1.6.7.2) @@ -189,6 +201,8 @@ GEM notiffany (0.0.8) nenv (~> 0.1) shellany (~> 0.0) + octokit (4.3.0) + sawyer (~> 0.7.0, >= 0.5.3) poltergeist (1.9.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -235,27 +249,30 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.16.0) - rake (11.1.1) + rake (10.5.0) rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) ref (2.0.0) - 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) + rspec (2.99.0) + rspec-core (~> 2.99.0) + rspec-expectations (~> 2.99.0) + rspec-mocks (~> 2.99.0) + rspec-collection_matchers (1.1.2) + rspec-expectations (>= 2.99.0.beta1) + rspec-core (2.99.2) + rspec-expectations (2.99.2) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.6) - rspec-rails (2.14.2) + rspec-mocks (2.99.4) + rspec-rails (2.99.0) actionpack (>= 3.0) activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) + rspec-collection_matchers + rspec-core (~> 2.99.0) + rspec-expectations (~> 2.99.0) + rspec-mocks (~> 2.99.0) ruby2ruby (2.3.0) ruby_parser (~> 3.1) sexp_processor (~> 4.0) @@ -269,6 +286,9 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + sawyer (0.7.0) + addressable (>= 2.3.5, < 2.5) + faraday (~> 0.8, < 0.10) sexp_processor (4.7.0) shellany (0.0.1) simplecov (0.11.2) @@ -297,7 +317,7 @@ GEM sqlite3 (1.3.11) temple (0.7.6) terminal-table (1.5.2) - test-unit (3.1.7) + test-unit (3.1.8) power_assert therubyracer (0.12.2) libv8 (~> 3.16.14.0) @@ -333,7 +353,7 @@ PLATFORMS ruby DEPENDENCIES - aruba + aruba (= 0.9.0.pre) bcrypt better_errors binding_of_caller @@ -346,6 +366,7 @@ DEPENDENCIES execjs foreman gauntlt + gemdiff guard-brakeman guard-livereload guard-rspec @@ -361,8 +382,9 @@ DEPENDENCIES pry-rails rack-livereload rails (= 4.2.6) + rake (= 10.5.0) rb-fsevent - rspec-rails (= 2.14.2) + rspec-rails (= 2.99.0) sass-rails simplecov sqlite3 diff --git a/spec/helpers/api/v1/users_helper_spec.rb b/spec/helpers/api/v1/users_helper_spec.rb index 9619df0..ddaf80a 100644 --- a/spec/helpers/api/v1/users_helper_spec.rb +++ b/spec/helpers/api/v1/users_helper_spec.rb @@ -13,4 +13,4 @@ describe Api::V1::UsersHelper do pending "add some examples to (or delete) #{__FILE__}" end -=end \ No newline at end of file +=end diff --git a/spec/helpers/password_resets_helper_spec.rb b/spec/helpers/password_resets_helper_spec.rb index b87346e..1e515dd 100644 --- a/spec/helpers/password_resets_helper_spec.rb +++ b/spec/helpers/password_resets_helper_spec.rb @@ -13,4 +13,4 @@ describe PasswordResetsHelper do pending "add some examples to (or delete) #{__FILE__}" end -=end \ No newline at end of file +=end diff --git a/spec/helpers/pay_helper_spec.rb b/spec/helpers/pay_helper_spec.rb index 408d779..b562100 100644 --- a/spec/helpers/pay_helper_spec.rb +++ b/spec/helpers/pay_helper_spec.rb @@ -13,4 +13,4 @@ describe PayHelper do pending "add some examples to (or delete) #{__FILE__}" end -=end \ No newline at end of file +=end diff --git a/spec/models/benefits_spec.rb b/spec/models/benefits_spec.rb index 043ae26..5dd5d00 100644 --- a/spec/models/benefits_spec.rb +++ b/spec/models/benefits_spec.rb @@ -11,7 +11,7 @@ describe User do end it "can be instantiated" do - Benefits.new.should be_an_instance_of(Benefits) + expect(Benefits.new).to be_an_instance_of(Benefits) end it "name can be updated" do @@ -19,6 +19,6 @@ describe User do user = User.all.first user.first_name = new_name user.save! - User.all.first.first_name.should == new_name + expect(User.all.first.first_name).to eq(new_name) end end diff --git a/spec/models/pay_spec.rb b/spec/models/pay_spec.rb index 1b4399c..40689ed 100644 --- a/spec/models/pay_spec.rb +++ b/spec/models/pay_spec.rb @@ -3,4 +3,4 @@ describe Pay do pending "add some examples to (or delete) #{__FILE__}" end -=end \ No newline at end of file +=end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index da9ae34..ff4b60f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -11,20 +11,20 @@ describe User do end it "can be instantiated" do - User.new.should be_an_instance_of(User) + expect(User.new).to be_an_instance_of(User) end it "should require a email" do - User.new(:email => "").should_not be_valid + expect(User.new(:email => "")).not_to be_valid end it "should require valid email" do - User.new(:email => "@gmail.com").should_not be_valid + expect(User.new(:email => "@gmail.com")).not_to be_valid end it "should require unique email" do user = User.all.first - User.new(:email => user.email).should_not be_valid + expect(User.new(:email => user.email)).not_to be_valid end it "name can be updated" do @@ -32,6 +32,6 @@ describe User do user = User.all.first user.first_name = new_name user.save! - User.all.first.first_name.should == new_name + expect(User.all.first.first_name).to eq(new_name) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0613768..01b1f31 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -51,6 +51,17 @@ RSpec.configure do |config| config.after(:each) do DatabaseCleaner.clean end + + # rspec-rails 3 will no longer automatically infer an example group's spec type + # from the file location. You can explicitly opt-in to the feature using this + # config option. + # To explicitly tag specs without using automatic inference, set the `:type` + # metadata manually: + # + # describe ThingsController, :type => :controller do + # # Equivalent to being in spec/controllers + # end + config.infer_spec_type_from_file_location! end Capybara.javascript_driver = :poltergeist diff --git a/spec/views/password_resets/new.html.erb_spec.rb b/spec/views/password_resets/new.html.erb_spec.rb index fcb6721..36f35d4 100644 --- a/spec/views/password_resets/new.html.erb_spec.rb +++ b/spec/views/password_resets/new.html.erb_spec.rb @@ -3,4 +3,4 @@ describe "password_resets/new.html.erb" do pending "add some examples to (or delete) #{__FILE__}" end -=end \ No newline at end of file +=end diff --git a/spec/vulnerabilities/command_injection_spec.rb b/spec/vulnerabilities/command_injection_spec.rb index 8baed81..31a8939 100644 --- a/spec/vulnerabilities/command_injection_spec.rb +++ b/spec/vulnerabilities/command_injection_spec.rb @@ -23,6 +23,6 @@ feature 'command injection' do end click_on 'Start Upload' end - pending(:if => verifying_fixed?) { File.exists?(legit_file).should be_false } + pending(:if => verifying_fixed?) { File.exists?(legit_file).should be_falsey } end -end \ No newline at end of file +end diff --git a/spec/vulnerabilities/mass_assignment_spec.rb b/spec/vulnerabilities/mass_assignment_spec.rb index 51dbc44..bf23aa2 100644 --- a/spec/vulnerabilities/mass_assignment_spec.rb +++ b/spec/vulnerabilities/mass_assignment_spec.rb @@ -7,7 +7,7 @@ feature 'mass assignment' do end scenario 'attack one' do - @normal_user.admin.should be_false + @normal_user.admin.should be_falsey login(@normal_user) @@ -17,7 +17,7 @@ feature 'mass assignment' do :password_confirmation => @normal_user.clear_password}} page.driver.put "/users/#{@normal_user.user_id}.json", params - pending(:if => verifying_fixed?) { @normal_user.reload.admin.should be_true } + pending(:if => verifying_fixed?) { @normal_user.reload.admin.should be_truthy } end scenario 'attack two' do @@ -31,7 +31,7 @@ feature 'mass assignment' do pending(:if => verifying_fixed?) { User.last.email.should == 'hackety@h4x0rs.c0m' - User.last.admin.should be_true + User.last.admin.should be_truthy } end end diff --git a/spec/vulnerabilities/sql_injection_spec.rb b/spec/vulnerabilities/sql_injection_spec.rb index 15ebdfd..cde02b8 100644 --- a/spec/vulnerabilities/sql_injection_spec.rb +++ b/spec/vulnerabilities/sql_injection_spec.rb @@ -8,7 +8,7 @@ feature 'sql injection' do end scenario 'attack' do - @admin_user.admin.should be_true + @admin_user.admin.should be_truthy login(@normal_user) @@ -29,4 +29,4 @@ feature 'sql injection' do @admin_user.admin.should == true } end -end \ No newline at end of file +end