From c12b1d067025987d7a0f722bc7aab850f48cf795 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Mon, 2 Jun 2014 22:02:44 +0200 Subject: [PATCH] Pre-transpec --- Gemfile | 19 +++++----- spec/lib/common/models/vulnerability_spec.rb | 39 ++++++++++---------- spec/spec_helper.rb | 1 + 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Gemfile b/Gemfile index fffa0bb7..df60cf4d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,13 +1,14 @@ -source "https://rubygems.org" +source 'https://rubygems.org' -gem "typhoeus", "~>0.6.8" -gem "nokogiri" -gem "json" -gem "terminal-table" -gem "ruby-progressbar", ">=1.4.2" +gem 'typhoeus', '~>0.6.8' +gem 'nokogiri' +gem 'json' +gem 'terminal-table' +gem 'ruby-progressbar', '>=1.4.2' group :test do - gem "webmock", ">=1.17.2" - gem "simplecov" - gem "rspec", :require => "spec" + gem 'webmock', '>=1.17.2' + gem 'simplecov' + gem 'rspec', '~>3.0' + gem 'rspec-its' end diff --git a/spec/lib/common/models/vulnerability_spec.rb b/spec/lib/common/models/vulnerability_spec.rb index c05b4f12..1da05258 100644 --- a/spec/lib/common/models/vulnerability_spec.rb +++ b/spec/lib/common/models/vulnerability_spec.rb @@ -13,18 +13,19 @@ describe Vulnerability do context 'w/o metasploit and fixed version modules argument' do subject(:vulnerability) { Vulnerability.new(title, type, references) } - its(:title) { should be title } - its(:references) { should be references } - its(:type) { should be type } - its(:fixed_in) { should be_empty } + its(:title) { should be title } + its(:references) { should be references } + its(:type) { should be type } + its(:fixed_in) { should be_empty } end context 'with fixed version argument' do - let(:fixed_version) { '1.0' } - its(:title) { should be title } - its(:references) { should be references } - its(:type) { should be type } - its(:fixed_in) { should be fixed_version } + let(:fixed_version) { '1.0' } + + its(:title) { should be title } + its(:references) { should be references } + its(:type) { should be type } + its(:fixed_in) { should be fixed_version } end end @@ -36,18 +37,18 @@ describe Vulnerability do } expected_refs = { - :url=>['Ref 1', 'Ref 2'], - :cve=>['2011-001'], - :secunia=>['secunia'], - :osvdb=>['osvdb'], - :metasploit=>['exploit/ex1'], - :exploitdb=>['exploitdb'] + :url => ['Ref 1', 'Ref 2'], + :cve => ['2011-001'], + :secunia => ['secunia'], + :osvdb => ['osvdb'], + :metasploit => ['exploit/ex1'], + :exploitdb => ['exploitdb'] } - its(:title) { should == 'Vuln Title' } - its(:type) { should == 'CSRF' } - its(:references) { should == expected_refs} - its(:fixed_in) { should == '1.0'} + its(:title) { should == 'Vuln Title' } + its(:type) { should == 'CSRF' } + its(:references) { should == expected_refs} + its(:fixed_in) { should == '1.0'} end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0d9398ec..2f895493 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,6 @@ # encoding: UTF-8 +require 'rspec/its' require 'webmock/rspec' # Code Coverage (only works with ruby >= 1.9) require 'simplecov' if RUBY_VERSION >= '1.9'