From 1df5570580c1d429a8fed25033a19333fcaffbda Mon Sep 17 00:00:00 2001 From: Igor Galić Date: Mon, 29 Sep 2014 19:19:21 +0200 Subject: Convert specs to RSpec 2.99.2 syntax with Transpec This conversion is done by Transpec 2.3.7 with the following command: transpec * 22 conversions from: it { should ... } to: it { is_expected.to ... } * 19 conversions from: obj.should to: expect(obj).to * 15 conversions from: == expected to: eq(expected) * 5 conversions from: it { should_not ... } to: it { is_expected.not_to ... } * 2 conversions from: its(:attr) { } to: describe '#attr' do subject { super().attr }; it { } end * 2 conversions from: obj.should_not to: expect(obj).not_to * 2 conversions from: proc { }.should to: expect { }.to * 1 conversion from: be_false to: be_falsey * 1 conversion from: be_true to: be_truthy For more details: https://github.com/yujinakayama/transpec#supported-conversions --- spec/acceptance/clone_repo_spec.rb | 49 ++++++++++++++++++-------------- spec/acceptance/create_repo_spec.rb | 8 +++--- spec/acceptance/remove_repo_spec.rb | 2 +- spec/acceptance/remove_repo_spec_noop.rb | 2 +- 4 files changed, 34 insertions(+), 27 deletions(-) (limited to 'spec/acceptance') diff --git a/spec/acceptance/clone_repo_spec.rb b/spec/acceptance/clone_repo_spec.rb index c52a5d2..f3e77db 100644 --- a/spec/acceptance/clone_repo_spec.rb +++ b/spec/acceptance/clone_repo_spec.rb @@ -30,11 +30,11 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo/.git") do - it { should be_directory } + it { is_expected.to be_directory } end describe file("#{tmpdir}/testrepo/.git/HEAD") do - it { should contain 'ref: refs/heads/master' } + it { is_expected.to contain 'ref: refs/heads/master' } end end @@ -63,11 +63,11 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_sha/.git") do - it { should be_directory } + it { is_expected.to be_directory } end describe file("#{tmpdir}/testrepo_sha/.git/HEAD") do - it { should contain sha } + it { is_expected.to contain sha } end end @@ -88,7 +88,7 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_tag/.git") do - it { should be_directory } + it { is_expected.to be_directory } end it 'should have the tag as the HEAD' do @@ -113,11 +113,11 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_branch/.git") do - it { should be_directory } + it { is_expected.to be_directory } end describe file("#{tmpdir}/testrepo_branch/.git/HEAD") do - it { should contain 'ref: refs/heads/a_branch' } + it { is_expected.to contain 'ref: refs/heads/a_branch' } end end @@ -183,7 +183,7 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_shallow/.git/shallow") do - it { should be_file } + it { is_expected.to be_file } end end @@ -229,8 +229,8 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_owner") do - it { should be_directory } - it { should be_owned_by 'vagrant' } + it { is_expected.to be_directory } + it { is_expected.to be_owned_by 'vagrant' } end end @@ -259,8 +259,8 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_group") do - it { should be_directory } - it { should be_grouped_into 'vagrant' } + it { is_expected.to be_directory } + it { is_expected.to be_grouped_into 'vagrant' } end end @@ -281,8 +281,15 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_excludes/.git/info/exclude") do - its(:content) { should match /exclude1.txt/ } - its(:content) { should match /exclude2.txt/ } + describe '#content' do + subject { super().content } + it { is_expected.to match /exclude1.txt/ } + end + + describe '#content' do + subject { super().content } + it { is_expected.to match /exclude2.txt/ } + end end end @@ -308,15 +315,15 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_force/folder") do - it { should_not be_directory } + it { is_expected.not_to be_directory } end describe file("#{tmpdir}/testrepo_force/temp.txt") do - it { should_not be_file } + it { is_expected.not_to be_file } end describe file("#{tmpdir}/testrepo_force/.git") do - it { should be_directory } + it { is_expected.to be_directory } end context 'and noop' do @@ -382,13 +389,13 @@ describe 'clones a remote repo' do end describe file("#{tmpdir}/testrepo_user") do - it { should be_directory } - it { should be_owned_by 'testuser' } + it { is_expected.to be_directory } + it { is_expected.to be_owned_by 'testuser' } end describe file("#{tmpdir}/testrepo_user") do - it { should be_directory } - it { should be_grouped_into 'testuser' } + it { is_expected.to be_directory } + it { is_expected.to be_grouped_into 'testuser' } end end diff --git a/spec/acceptance/create_repo_spec.rb b/spec/acceptance/create_repo_spec.rb index 1b46449..db0cd29 100644 --- a/spec/acceptance/create_repo_spec.rb +++ b/spec/acceptance/create_repo_spec.rb @@ -26,7 +26,7 @@ describe 'create a repo' do end describe file("#{tmpdir}/testrepo_blank_repo/.git") do - it { should be_directory } + it { is_expected.to be_directory } end end @@ -45,11 +45,11 @@ describe 'create a repo' do end describe file("#{tmpdir}/testrepo_bare_repo/config") do - it { should contain 'bare = true' } + it { is_expected.to contain 'bare = true' } end describe file("#{tmpdir}/testrepo_bare_repo/.git") do - it { should_not be_directory } + it { is_expected.not_to be_directory } end end @@ -67,7 +67,7 @@ describe 'create a repo' do end describe file("#{tmpdir}/testrepo_bare_repo_rev") do - it { should_not be_directory } + it { is_expected.not_to be_directory } end end end diff --git a/spec/acceptance/remove_repo_spec.rb b/spec/acceptance/remove_repo_spec.rb index d22d9db..d5646b3 100644 --- a/spec/acceptance/remove_repo_spec.rb +++ b/spec/acceptance/remove_repo_spec.rb @@ -25,6 +25,6 @@ describe 'remove a repo' do end describe file("#{tmpdir}/testrepo_deleted") do - it { should_not be_directory } + it { is_expected.not_to be_directory } end end diff --git a/spec/acceptance/remove_repo_spec_noop.rb b/spec/acceptance/remove_repo_spec_noop.rb index 154f25a..f6bd86e 100644 --- a/spec/acceptance/remove_repo_spec_noop.rb +++ b/spec/acceptance/remove_repo_spec_noop.rb @@ -26,6 +26,6 @@ describe 'does not remove a repo if noop' do end describe file("#{tmpdir}/testrepo_noop_deleted") do - it { should be_directory } + it { is_expected.to be_directory } end end -- cgit v1.2.3