1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
From: Hleb Valoshka <375gnu@gmail.com>
Date: Thu, 24 Mar 2016 16:48:08 +0300
Subject: Update rspec syntax with transpec
---
spec/unit/berkshelf/api_client/connection_spec.rb | 4 +--
.../berkshelf/api_client/remote_cookbook_spec.rb | 35 ++++++++++++++++++----
2 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/spec/unit/berkshelf/api_client/connection_spec.rb b/spec/unit/berkshelf/api_client/connection_spec.rb
index b79fa68..8d3f3d7 100644
--- a/spec/unit/berkshelf/api_client/connection_spec.rb
+++ b/spec/unit/berkshelf/api_client/connection_spec.rb
@@ -21,7 +21,7 @@ describe Berkshelf::APIClient::Connection do
end
it "contains a item for each dependency" do
- expect(subject).to have(3).items
+ expect(subject.size).to eq(3)
expect(subject[0].name).to eql("ruby")
expect(subject[0].version).to eql("1.2.3")
expect(subject[1].name).to eql("ruby")
@@ -56,7 +56,7 @@ describe Berkshelf::APIClient::Connection do
context "when the connection to the service fails" do
before do
- instance.should_receive(:get).and_raise(Faraday::Error::ConnectionFailed.new(StandardError))
+ expect(instance).to receive(:get).and_raise(Faraday::Error::ConnectionFailed.new(StandardError))
end
it "raises a Berkshelf::APIClient::ServiceUnavaiable" do
diff --git a/spec/unit/berkshelf/api_client/remote_cookbook_spec.rb b/spec/unit/berkshelf/api_client/remote_cookbook_spec.rb
index 5078671..c721671 100644
--- a/spec/unit/berkshelf/api_client/remote_cookbook_spec.rb
+++ b/spec/unit/berkshelf/api_client/remote_cookbook_spec.rb
@@ -14,10 +14,33 @@ describe Berkshelf::APIClient::RemoteCookbook do
subject { described_class.new(name, version, attributes) }
- its(:name) { should eql(name) }
- its(:version) { should eql(version) }
- its(:dependencies) { should eql(dependencies) }
- its(:platforms) { should eql(platforms) }
- its(:location_type) { should eql(:chef_server) }
- its(:location_path) { should eql(location_path) }
+ describe '#name' do
+ subject { super().name }
+ it { is_expected.to eql(name) }
+ end
+
+ describe '#version' do
+ subject { super().version }
+ it { is_expected.to eql(version) }
+ end
+
+ describe '#dependencies' do
+ subject { super().dependencies }
+ it { is_expected.to eql(dependencies) }
+ end
+
+ describe '#platforms' do
+ subject { super().platforms }
+ it { is_expected.to eql(platforms) }
+ end
+
+ describe '#location_type' do
+ subject { super().location_type }
+ it { is_expected.to eql(:chef_server) }
+ end
+
+ describe '#location_path' do
+ subject { super().location_path }
+ it { is_expected.to eql(location_path) }
+ end
end
|