simple_command 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_command/errors.rb +1 -1
- data/lib/simple_command/utils.rb +14 -0
- data/lib/simple_command/version.rb +1 -1
- data/lib/simple_command.rb +1 -0
- data/spec/simple_command/errors_spec.rb +18 -6
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 249c45e067f58dd59ee7a290622613123271bf8a484aecab8df78eac08877c72
|
4
|
+
data.tar.gz: 8fccb81df727ae775e638a2777b362aa551c7240591f22d76e703f1652daa010
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3343d18527c57e54204a0f7610c9574632918a8964d4bf85429f13ac918700741952e2c8401616ae37098ccd03a22968afe5b195459583cd339277d656fd0eb8
|
7
|
+
data.tar.gz: 9e416787a1e7b8a19d92071ae662a76a301e184a73e8d34c70398eb7d5130b97689afa9b792425b96b32540ecabfe3dae2514f4421f7f8ac2429ce110df59cb9
|
data/lib/simple_command.rb
CHANGED
@@ -19,21 +19,33 @@ describe SimpleCommand::Errors do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '#add_multiple_errors' do
|
22
|
-
|
23
|
-
{
|
22
|
+
it 'populates itself with the added errors' do
|
23
|
+
errors_list = {
|
24
24
|
some_error: ['some error description'],
|
25
25
|
another_error: ['another error description']
|
26
26
|
}
|
27
|
-
end
|
28
27
|
|
29
|
-
before do
|
30
28
|
errors.add_multiple_errors errors_list
|
31
|
-
end
|
32
29
|
|
33
|
-
it 'populates itself with the added errors' do
|
34
30
|
expect(errors[:some_error]).to eq(errors_list[:some_error])
|
35
31
|
expect(errors[:another_error]).to eq(errors_list[:another_error])
|
36
32
|
end
|
33
|
+
|
34
|
+
it 'copies errors from another SimpleCommand::Errors object' do
|
35
|
+
command_errors = SimpleCommand::Errors.new
|
36
|
+
command_errors.add :some_error, "was found"
|
37
|
+
command_errors.add :some_error, "happened again"
|
38
|
+
|
39
|
+
errors.add_multiple_errors command_errors
|
40
|
+
|
41
|
+
expect(errors[:some_error]).to eq(["was found", "happened again"])
|
42
|
+
end
|
43
|
+
|
44
|
+
it "ignores nil values" do
|
45
|
+
errors.add_multiple_errors({:foo => nil})
|
46
|
+
|
47
|
+
expect(errors[:foo]).to eq nil
|
48
|
+
end
|
37
49
|
end
|
38
50
|
|
39
51
|
describe '#each' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Pavoni
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- Rakefile
|
70
70
|
- lib/simple_command.rb
|
71
71
|
- lib/simple_command/errors.rb
|
72
|
+
- lib/simple_command/utils.rb
|
72
73
|
- lib/simple_command/version.rb
|
73
74
|
- simple_command.gemspec
|
74
75
|
- spec/factories/missed_call_command.rb
|