@@ -14,13 +14,6 @@ def catalog_from_fixture(path)
14
14
end
15
15
16
16
describe '#file_path' do
17
- it 'should raise ArgumentError for unexpected format of file name' do
18
- src = 'asldfkjwoeifjslakfj'
19
- expect do
20
- OctocatalogDiff ::CatalogUtil ::FileResources . file_path ( src , [ ] )
21
- end . to raise_error ( ArgumentError , /Bad parameter source/ )
22
- end
23
-
24
17
it 'should return path if file is found' do
25
18
allow ( File ) . to receive ( :exist? ) . and_call_original
26
19
allow ( File ) . to receive ( :exist? ) . with ( '/a/foo/files/bar' ) . and_return ( true )
@@ -62,18 +55,14 @@ def catalog_from_fixture(path)
62
55
expect ( result ) . to be_nil
63
56
end
64
57
65
- it 'should raise an error if the only entry is malformed' do
58
+ it 'should return nil if the only entry is malformed' do
66
59
tries = 'sddfsdfsdf'
67
- expect do
68
- OctocatalogDiff ::CatalogUtil ::FileResources . file_path ( tries , [ '/a' ] )
69
- end . to raise_error ( ArgumentError , /Bad parameter source/ )
60
+ expect ( OctocatalogDiff ::CatalogUtil ::FileResources . file_path ( tries , [ '/a' ] ) ) . to be_nil
70
61
end
71
62
72
- it 'should raise an error if the all entries are malformed' do
63
+ it 'should return nil if the all entries are malformed' do
73
64
tries = %w[ sddfsdfsdf asdfasfdasdf ]
74
- expect do
75
- OctocatalogDiff ::CatalogUtil ::FileResources . file_path ( tries , [ '/a' ] )
76
- end . to raise_error ( ArgumentError , /Bad parameter source/ )
65
+ expect ( OctocatalogDiff ::CatalogUtil ::FileResources . file_path ( tries , [ '/a' ] ) ) . to be_nil
77
66
end
78
67
end
79
68
0 commit comments