Skip to content

Commit

Permalink
Update to rspec3
Browse files Browse the repository at this point in the history
Signed-off-by: dmitriy kalinin <[email protected]>
  • Loading branch information
Jeffrey Peckham authored and Rob Day-Reynolds committed Dec 27, 2013
1 parent 7e1ac47 commit 94184a6
Show file tree
Hide file tree
Showing 33 changed files with 52 additions and 68 deletions.
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ group :development, :test do
gemspec path: 'bosh-dev'
gemspec path: 'bosh-stemcell'

gem 'rspec'
gem 'rspec-its'
gem 'rspec-fire'
gem 'rspec-instafail'

gem 'rubocop', require: false
gem 'parallel_tests'
gem 'rack-test'
gem 'ci_reporter'
gem 'rspec'
gem 'rspec-fire'
gem 'rspec-instafail'
gem 'webmock'
gem 'fakefs'
gem 'simplecov'
Expand Down
24 changes: 14 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ GEM
debugger-ruby_core_source (~> 1.2.1)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
diff-lcs (1.2.4)
diff-lcs (1.2.5)
dogapi (1.6.0)
json (>= 1.5.1)
em-http-request (0.3.0)
Expand Down Expand Up @@ -337,17 +337,20 @@ GEM
vegas (~> 0.1.2)
rest-client (1.6.7)
mime-types (>= 1.16)
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.3)
rspec (3.0.0.beta1)
rspec-core (= 3.0.0.beta1)
rspec-expectations (= 3.0.0.beta1)
rspec-mocks (= 3.0.0.beta1)
rspec-core (3.0.0.beta1)
rspec-expectations (3.0.0.beta1)
diff-lcs (>= 1.1.3, < 2.0)
rspec-fire (1.2.0)
rspec (~> 2.11)
rspec-support (= 3.0.0.beta1)
rspec-fire (1.3.0)
rspec (>= 2.11, < 4)
rspec-instafail (0.2.4)
rspec-mocks (2.14.4)
rspec-its (1.0.0.pre)
rspec-mocks (3.0.0.beta1)
rspec-support (3.0.0.beta1)
rubocop (0.10.0)
backports (~> 3.3.3)
parser (= 2.0.0.pre2)
Expand Down Expand Up @@ -453,6 +456,7 @@ DEPENDENCIES
rspec
rspec-fire
rspec-instafail
rspec-its
rubocop
ruby_gntp
rugged
Expand Down
2 changes: 1 addition & 1 deletion bosh-dev/bosh-dev.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'fakefs'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rspec-fire'
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'rugged'
end
5 changes: 2 additions & 3 deletions bosh-dev/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rspec'
require 'rspec/its'
require 'rake'
require 'fakefs/spec_helpers'
require 'webmock/rspec'
Expand All @@ -17,9 +18,7 @@ class VSphereSpecConfig

Bosh::Clouds::Config.configure(config)

Dir.glob(File.expand_path('support/**/*.rb', File.dirname(__FILE__))).each do |support|
require support
end
Dir.glob(File.expand_path('support/**/*.rb', File.dirname(__FILE__))).each { |f| require f }

SPEC_ROOT = File.dirname(__FILE__)

Expand Down
9 changes: 0 additions & 9 deletions bosh-dev/spec/support/rspec_fire.rb

This file was deleted.

1 change: 1 addition & 0 deletions bosh-director/bosh-director.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'fakefs'
s.add_development_dependency 'machinist', '~>1.0'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rspec-its'
s.add_development_dependency 'rspec-fire'

s.bindir = 'bin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ClassToStub; end

describe 'instance_double (Rspec::Fire::FireObjectDouble)' do
describe 'instance_double' do
describe '#initialize' do
context 'when trying to stub non-existent method' do
it 'raises an error' do
Expand Down
8 changes: 3 additions & 5 deletions bosh-director/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright (c) 2009-2012 VMware, Inc.
$: << File.expand_path('..', __FILE__)

require 'digest/sha1'
Expand All @@ -10,14 +9,15 @@
require 'zlib'

require 'archive/tar/minitar'
require 'machinist/sequel'
require 'rspec'
require 'rspec/its'
require 'machinist/sequel'
require 'sham'
require 'support/job_example_group'
require 'support/rspec_fire'
require 'support/task_helpers'

RSpec.configure do |config|
config.deprecation_stream = StringIO.new
config.include Bosh::Director::Test::TaskHelpers
end

Expand Down Expand Up @@ -430,5 +430,3 @@ def create_release_tarball(manifest)

module_function :create_release_tarball
end


2 changes: 1 addition & 1 deletion bosh-stemcell/bosh-stemcell.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'fakefs'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rspec-fire'
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'serverspec'
spec.add_development_dependency 'foodcritic'
Expand Down
1 change: 1 addition & 0 deletions bosh-stemcell/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rspec'
require 'rspec/its'
require 'fakefs/spec_helpers'

Dir.glob(File.expand_path('support/**/*.rb', File.dirname(__FILE__))).each do |support|
Expand Down
9 changes: 0 additions & 9 deletions bosh-stemcell/spec/support/rspec_fire.rb

This file was deleted.

2 changes: 1 addition & 1 deletion bosh_agent/spec/unit/bootstrap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
it "creates a data/sys/#{dir} directory" do
path = "/tmp/somedir/data/sys/#{dir}"
@processor.setup_data_sys
expect(File.directory?(path)).to be_true
expect(File.directory?(path)).to be(true)
expect(File.stat(path).gid).to eq(42)
expect(File.stat(path).mode).to eq(canary_dir_mode)
end
Expand Down
10 changes: 5 additions & 5 deletions bosh_agent/spec/unit/infrastructure/vsphere/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@

settings.cdrom_retry_wait = 0.1

settings.stub!(:mount_cdrom)
settings.stub!(:umount_cdrom)
settings.stub!(:eject_cdrom)
settings.stub!(:udevadm_settle)
settings.stub!(:read_cdrom_byte)
settings.stub(:mount_cdrom)
settings.stub(:umount_cdrom)
settings.stub(:eject_cdrom)
settings.stub(:udevadm_settle)
settings.stub(:read_cdrom_byte)

settings.read_cdrom_byte
end
Expand Down
6 changes: 2 additions & 4 deletions bosh_agent/spec/unit/message/drain_spec.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Copyright (c) 2009-2012 VMware, Inc.
require 'spec_helper'
require 'fileutils'

describe Bosh::Agent::Message::Drain do

def set_state(state)
state_file = Tempfile.new('agent-state')
state_file.write(Psych.dump(state))
state_file.close
Bosh::Agent::Config.state = Bosh::Agent::State.new(state_file.path)
end

before(:each) do
@nats = mock
before do
@nats = double

Bosh::Agent::Config.logger = Logger.new(StringIO.new)
Bosh::Agent::Config.nats = @nats
Expand Down
2 changes: 1 addition & 1 deletion bosh_agent/spec/unit/message/migrate_disk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
describe '.process' do
it 'delegates to #migrate and returns an empty hash' do
message = double('migrate_disk message')
described_class.should_receive(:new).with().and_return(message)
described_class.should_receive(:new).with(no_args).and_return(message)
message.should_receive(:migrate).with(["old_disk_cid", "new_disk_cid"])

described_class.process(["old_disk_cid", "new_disk_cid"]).should eq({})
Expand Down
2 changes: 2 additions & 0 deletions bosh_cli/bosh_cli.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Gem::Specification.new do |s|
s.add_dependency 'minitar', '~>0.5.4'

s.add_development_dependency 'fakefs'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rspec-its'
s.add_development_dependency 'rspec-fire'
s.add_development_dependency 'webmock'
end
11 changes: 4 additions & 7 deletions bosh_cli/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
require 'rspec/core'
require 'rspec'
require 'rspec/its'
require 'webmock'
require 'timecop'

require 'cli'

Dir.glob(File.expand_path('support/**/*.rb', File.dirname(__FILE__))).each do |support|
require support
end
Dir.glob(File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require(f) }

require 'support/command_shared_examples'

Expand All @@ -15,7 +13,7 @@ def spec_asset(dir_or_file_name)
end

RSpec.configure do |c|
c.before(:each) do
c.before do
Bosh::Cli::Config.interactive = false
Bosh::Cli::Config.colorize = false
Bosh::Cli::Config.output = StringIO.new
Expand All @@ -30,6 +28,5 @@ def get_tmp_file_path(content)
tmp_file = File.open(File.join(Dir.mktmpdir, 'tmp'), 'w')
tmp_file.write(content)
tmp_file.close

tmp_file.path
end
2 changes: 2 additions & 0 deletions bosh_cli_plugin_aws/bosh_cli_plugin_aws.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency 'bosh_cli_plugin_micro', "~>#{version}"
s.add_dependency 'bosh-stemcell', "~>#{version}"

s.add_development_dependency 'rspec'
s.add_development_dependency 'rspec-its'
s.add_development_dependency 'rspec-fire'
end
14 changes: 6 additions & 8 deletions bosh_cli_plugin_aws/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require "cli"
require "bosh/cli/commands/aws"
require "bosh_cli_plugin_aws"
require 'rspec'
require 'rspec/its'
require 'webmock/rspec'
require 'cli'
require 'bosh/cli/commands/aws'
require 'bosh_cli_plugin_aws'

Dir[File.expand_path("./support/*", File.dirname(__FILE__))].each do |support_file|
require support_file
end
Dir[File.expand_path('../support/*', __FILE__)].each { |f| require(f) }

def asset(filename)
File.join(File.dirname(__FILE__), 'assets', filename)
Expand All @@ -16,9 +16,7 @@ def encoded_credentials(username, password)
end

RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus

config.order = 'random'
end
Binary file removed vendor/cache/diff-lcs-1.2.4.gem
Binary file not shown.
Binary file added vendor/cache/diff-lcs-1.2.5.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-2.14.1.gem
Binary file not shown.
Binary file added vendor/cache/rspec-3.0.0.beta1.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-core-2.14.7.gem
Binary file not shown.
Binary file added vendor/cache/rspec-core-3.0.0.beta1.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-expectations-2.14.3.gem
Binary file not shown.
Binary file added vendor/cache/rspec-expectations-3.0.0.beta1.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-fire-1.2.0.gem
Binary file not shown.
Binary file added vendor/cache/rspec-fire-1.3.0.gem
Binary file not shown.
Binary file added vendor/cache/rspec-its-1.0.0.pre.gem
Binary file not shown.
Binary file removed vendor/cache/rspec-mocks-2.14.4.gem
Binary file not shown.
Binary file added vendor/cache/rspec-mocks-3.0.0.beta1.gem
Binary file not shown.
Binary file added vendor/cache/rspec-support-3.0.0.beta1.gem
Binary file not shown.

0 comments on commit 94184a6

Please sign in to comment.