yamload 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 161994d9e2aa6fad809740f83e92e1753b0b49ad
4
- data.tar.gz: addc311926f473c5ab0863322bfda534b05ee992
3
+ metadata.gz: cdaf18e91f87fa915da696af9e2d41d171313512
4
+ data.tar.gz: 93ed1e30105693344286755d3bd04db2f22d9032
5
5
  SHA512:
6
- metadata.gz: cb4d5eef83acc10360ce1b93c03626f1728ec27a0220f96112fcef79ae676af874cec54f1732aa4f981ceb5401a714f3d151de4c2e3272d0df587ab13040dc02
7
- data.tar.gz: 8efea007b9e6ba02aaa801ec3dc4ab29af39a3b821631c95867c3a68a38765a60028f00a9f4d391407b5913563f5b30de0d5c7569e6ae37af0ff7d859fd1a7ff
6
+ metadata.gz: 8be6ad15459108a185e1d68c256e8174a7f7f2e92579c057184fcd28d94dbf9cdd4ec04674cb15e8e9fc0051c60d0d748e3ab67eafe52ed0d58ea07a494b4310
7
+ data.tar.gz: 2d2ce03a03a7818d5195e5d1efe8eaf0c1c1439ab6bbd41dff97587cc178758a31ee4c1f3b5a125fad41df3706ddbd2453be8c6b5ac84f933d00a2104737d147
@@ -68,6 +68,8 @@ module Yamload
68
68
  end
69
69
 
70
70
  def filepath
71
+ fail IOError, 'No yml files directory specified' if @dir.nil?
72
+ fail IOError, "#{@dir} is not a valid directory" unless File.directory?(@dir)
71
73
  File.join(@dir, "#{@file}.yml")
72
74
  end
73
75
  end
@@ -1,3 +1,3 @@
1
1
  module Yamload
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/spec/loader_spec.rb CHANGED
@@ -8,6 +8,18 @@ describe Yamload do
8
8
 
9
9
  specify { expect(loader).to exist }
10
10
 
11
+ context 'if the directory is not specified' do
12
+ let(:loader) { Yamload::Loader.new(file, nil) }
13
+ specify { expect { config }.to raise_error IOError, 'No yml files directory specified' }
14
+ end
15
+
16
+ context 'if the directory is invalid' do
17
+ let(:current_file_dir) { File.expand_path(File.dirname(__FILE__)) }
18
+ let(:invalid_dir) { File.join(current_file_dir, 'invalid') }
19
+ let(:loader) { Yamload::Loader.new(file, invalid_dir) }
20
+ specify { expect { config }.to raise_error IOError, "#{invalid_dir} is not a valid directory" }
21
+ end
22
+
11
23
  context 'with a non existing file' do
12
24
  let(:file) { :non_existing }
13
25
  specify { expect(loader).not_to exist }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Berardi