spec/unit/berkshelf/mercurial_spec.rb in berkshelf-3.0.0.beta4 vs spec/unit/berkshelf/mercurial_spec.rb in berkshelf-3.0.0.beta5

- old
+ new

@@ -1,14 +1,13 @@ require 'spec_helper' describe Berkshelf::Mercurial do - include Berkshelf::RSpec::Mercurial let(:hg) { Berkshelf::Mercurial } - describe '.find_hg' do + describe '::find_hg' do it 'finds hg' do expect(described_class.find_hg).to_not be_nil end it 'raises an error if mercurial cannot be not found' do @@ -18,11 +17,11 @@ described_class.find_hg }.to raise_error(Berkshelf::MercurialNotFound) end end - describe '.clone' do + describe '::clone' do let(:target) { clone_path('nginx') } it 'clones the repository to the target path' do origin_uri = mercurial_origin_for('nginx') @@ -31,11 +30,11 @@ expect(target).to exist expect(target).to be_directory end end - describe '.checkout' do + describe '::checkout' do let(:repo_path) { clone_path('nginx') } let(:repo) { origin_uri = mercurial_origin_for('nginx', tags: ['1.0.1', '1.0.2'], branches: ['topic', 'next_topic']) hg.clone(origin_uri, repo_path) } @@ -92,11 +91,11 @@ it_behaves_like 'able to checkout hg rev', 'topic' end end end - describe '.rev_parse' do + describe '::rev_parse' do let(:repo_path) { clone_path('nginx') } before(:each) do origin_uri = mercurial_origin_for('nginx', tags: ['1.1.1']) described_class.clone(origin_uri, repo_path) @@ -113,11 +112,11 @@ let(:https_uri) { 'https://hghub.com/reset/' } let(:http_uri) { 'http://hghub.com/reset/' } let(:invalid_uri) { '/something/on/disk' } - describe '.validate_uri' do + describe '::validate_uri' do context 'given an invalid URI' do it 'returns false' do expect(described_class.validate_uri(invalid_uri)).to be_false end end @@ -139,10 +138,10 @@ expect(described_class.validate_uri(123)).to be_false end end end - describe '.validate_uri!' do + describe '::validate_uri!' do context 'given an invalid URI' do it 'raises InvalidHgURI' do expect { described_class.validate_uri!(invalid_uri) }.to raise_error(Berkshelf::InvalidHgURI)