spec/unit/berkshelf/git_spec.rb in berkshelf-0.4.0.rc2 vs spec/unit/berkshelf/git_spec.rb in berkshelf-0.4.0.rc3

- old
+ new

@@ -56,11 +56,10 @@ end end let(:readonly_uri) { "git://github.com/reset/thor-foodcritic.git" } let(:https_uri) { "https://github.com/reset/solve.git" } - let(:ssh_uri) { "git@github.com:reset/solve.git" } let(:http_uri) { "http://github.com/reset/solve.git" } let(:invalid_uri) { "/something/on/disk" } describe "::validate_uri" do context "given a valid Git read-only URI" do @@ -73,16 +72,22 @@ it "returns true" do subject.validate_uri(https_uri).should be_true end end - context "given a valid Git SSH URI" do + context "given a valid Github SSH URI" do it "returns true" do - subject.validate_uri(ssh_uri).should be_true + subject.validate_uri("git@github.com:reset/solve.git").should be_true end end + context "given a valid SSH URI without an 'organization'" do + it "returns true" do + subject.validate_uri("gituser@githost:solve.git").should be_true + end + end + context "given an invalid URI" do it "returns false" do subject.validate_uri(invalid_uri).should be_false end end @@ -113,10 +118,16 @@ end end context "given a valid Git SSH URI" do it "returns true" do - subject.validate_uri!(ssh_uri).should be_true + subject.validate_uri!("git@github.com:reset/solve.git").should be_true + end + end + + context "given a valid SSH URI without an 'organization'" do + it "returns true" do + subject.validate_uri("gituser@githost:solve.git").should be_true end end context "given an invalid URI" do it "raises InvalidGitURI" do