Commit 58dad2b95463ae0bb0fd21258804f32352f0a6b5
1 parent
3606a148
Exists in
master
and in
4 other branches
Remove leftover ref_extractor_spec file
Apparently it didn't get removed after the rename to ExtractsPath.
Showing
1 changed file
with
0 additions
and
58 deletions
Show diff stats
spec/lib/ref_extractor_spec.rb
| @@ -1,58 +0,0 @@ | @@ -1,58 +0,0 @@ | ||
| 1 | -require 'spec_helper' | ||
| 2 | - | ||
| 3 | -describe ExtractsPath do | ||
| 4 | - include ExtractsPath | ||
| 5 | - | ||
| 6 | - let(:project) { double('project') } | ||
| 7 | - | ||
| 8 | - before do | ||
| 9 | - @project = project | ||
| 10 | - project.stub(:branches).and_return(['master', 'foo/bar/baz']) | ||
| 11 | - project.stub(:tags).and_return(['v1.0.0', 'v2.0.0']) | ||
| 12 | - end | ||
| 13 | - | ||
| 14 | - describe '#extract_ref' do | ||
| 15 | - it "returns an empty pair when no @project is set" do | ||
| 16 | - @project = nil | ||
| 17 | - extract_ref('master/CHANGELOG').should == ['', ''] | ||
| 18 | - end | ||
| 19 | - | ||
| 20 | - context "without a path" do | ||
| 21 | - it "extracts a valid branch" do | ||
| 22 | - extract_ref('master').should == ['master', ''] | ||
| 23 | - end | ||
| 24 | - | ||
| 25 | - it "extracts a valid tag" do | ||
| 26 | - extract_ref('v2.0.0').should == ['v2.0.0', ''] | ||
| 27 | - end | ||
| 28 | - | ||
| 29 | - it "extracts a valid commit ref without a path" do | ||
| 30 | - extract_ref('f4b14494ef6abf3d144c28e4af0c20143383e062').should == | ||
| 31 | - ['f4b14494ef6abf3d144c28e4af0c20143383e062', ''] | ||
| 32 | - end | ||
| 33 | - | ||
| 34 | - it "falls back to a primitive split for an invalid ref" do | ||
| 35 | - extract_ref('stable').should == ['stable', ''] | ||
| 36 | - end | ||
| 37 | - end | ||
| 38 | - | ||
| 39 | - context "with a path" do | ||
| 40 | - it "extracts a valid branch" do | ||
| 41 | - extract_ref('foo/bar/baz/CHANGELOG').should == ['foo/bar/baz', 'CHANGELOG'] | ||
| 42 | - end | ||
| 43 | - | ||
| 44 | - it "extracts a valid tag" do | ||
| 45 | - extract_ref('v2.0.0/CHANGELOG').should == ['v2.0.0', 'CHANGELOG'] | ||
| 46 | - end | ||
| 47 | - | ||
| 48 | - it "extracts a valid commit SHA" do | ||
| 49 | - extract_ref('f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG').should == | ||
| 50 | - ['f4b14494ef6abf3d144c28e4af0c20143383e062', 'CHANGELOG'] | ||
| 51 | - end | ||
| 52 | - | ||
| 53 | - it "falls back to a primitive split for an invalid ref" do | ||
| 54 | - extract_ref('stable/CHANGELOG').should == ['stable', 'CHANGELOG'] | ||
| 55 | - end | ||
| 56 | - end | ||
| 57 | - end | ||
| 58 | -end |