Skip to content

Commit

Permalink
update RSpec config
Browse files Browse the repository at this point in the history
- the expect syntax is default in RSpec3 (no need to set it)
- enable verifying doubles, remove the obsolete mocks
- use RSpec3 at Travis
  • Loading branch information
lslezak committed Sep 11, 2015
1 parent 7aa3d8a commit a7cec89
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ group :test do
gem "rake"
gem "yard"
gem "yast-rake", ">= 0.1.9"
gem "rspec", "~> 2.14.0"
gem "rspec", "~> 3.3.2"
gem "gettext", require: false
gem "rubocop", "~> 0.29.1", require: false
gem "simplecov", require: false
Expand Down
1 change: 0 additions & 1 deletion test/finish_dialog_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
it "do nothing if system is not registered" do
expect(Registration::Registration).to receive(:is_registered?).once
.and_return(false)
expect_any_instance_of(SUSE::Connect::Config).to_not receive(:write)
expect(Yast::Pkg).to_not receive(:SourceSetEnabled)

subject.run("Write")
Expand Down
1 change: 0 additions & 1 deletion test/registration_ui_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@

# stub the registration
allow(registration).to receive(:register_product)
allow(registration).to receive(:select_repositories)
end

it "does not ask for reg. code if all addons are free" do
Expand Down
8 changes: 3 additions & 5 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
end
end

# allow only the new "expect" RSpec syntax
# configure RSpec
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.mock_with :rspec do |c|
c.syntax = :expect
# https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial-doubles
c.verify_partial_doubles = true
end
end

Expand Down

0 comments on commit a7cec89

Please sign in to comment.