kalibro_gem 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/features/step_definitions/base_tool_steps.rb +5 -5
- data/features/step_definitions/processing_steps.rb +6 -6
- data/kalibro_gem.gemspec +3 -2
- data/lib/kalibro_gem/version.rb +1 -1
- data/spec/entities/base_tool_spec.rb +13 -13
- data/spec/entities/configuration_spec.rb +5 -5
- data/spec/entities/date_metric_result_spec.rb +5 -5
- data/spec/entities/date_module_result_spec.rb +5 -5
- data/spec/entities/metric_configuration_snapshot_spec.rb +10 -10
- data/spec/entities/metric_configuration_spec.rb +14 -14
- data/spec/entities/metric_result_spec.rb +17 -17
- data/spec/entities/metric_spec.rb +3 -3
- data/spec/entities/model_spec.rb +30 -30
- data/spec/entities/module_result_spec.rb +14 -14
- data/spec/entities/process_time_spec.rb +2 -2
- data/spec/entities/processing_spec.rb +23 -23
- data/spec/entities/project_spec.rb +5 -5
- data/spec/entities/range_snapshot_spec.rb +5 -5
- data/spec/entities/range_spec.rb +20 -20
- data/spec/entities/reading_group_spec.rb +5 -5
- data/spec/entities/reading_spec.rb +11 -11
- data/spec/entities/repository_observer_spec.rb +14 -14
- data/spec/entities/repository_spec.rb +12 -12
- data/spec/entities/stack_trace_element_spec.rb +1 -1
- data/spec/entities/throwable_spec.rb +4 -4
- data/spec/helpers/aggregation_options_spec.rb +1 -1
- data/spec/helpers/hash_converters_spec.rb +10 -10
- data/spec/helpers/xml_converters_spec.rb +5 -5
- data/spec/kalibro_entities_spec.rb +10 -11
- data/spec/spec_helper.rb +62 -6
- metadata +21 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f53dd9fdd8430619803d8c37057337198b5d4f0
|
4
|
+
data.tar.gz: 301c5575dad6621774ea2e7f0724a2d64a9f52c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb4ff24906ab85ac86ce86138e9487c34a4da12d5ad1293cf4dd71370808d1d4f409b9b98791dfd524e5000a97f0b1db061e5c87b03e009befc23799864ba0e2
|
7
|
+
data.tar.gz: ad30f6e757a0df851a7ff790de6d8cfc063379d8e848740dd0b175e9409d24e2739d3bcc453a972b3cf5db5ed958174f56f953af37b5d482a5d81c3cf132b283
|
data/.rspec
ADDED
@@ -8,21 +8,21 @@ end
|
|
8
8
|
|
9
9
|
When(/^I search base tool Avalio by name$/) do
|
10
10
|
@is_error = false
|
11
|
-
begin
|
11
|
+
begin
|
12
12
|
KalibroGem::Entities::BaseTool.find_by_name("Avalio")
|
13
13
|
rescue KalibroGem::Errors::RecordNotFound
|
14
|
-
@is_error = true
|
14
|
+
@is_error = true
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
Then(/^it should return Checkstyle and Analizo strings inside of an array$/) do
|
19
|
-
(@base_tool_names.include?("Checkstyle") && @base_tool_names.include?("Analizo")).
|
19
|
+
expect(@base_tool_names.include?("Checkstyle") && @base_tool_names.include?("Analizo")).to be_truthy
|
20
20
|
end
|
21
21
|
|
22
22
|
Then(/^I should get Analizo base tool$/) do
|
23
|
-
@result.name.
|
23
|
+
expect(@result.name).to eq("Analizo")
|
24
24
|
end
|
25
25
|
|
26
26
|
Then(/^I should get an error$/) do
|
27
|
-
@is_error.
|
27
|
+
expect(@is_error).to be_truthy
|
28
28
|
end
|
@@ -67,25 +67,25 @@ When(/^I call the processing_with_date_of method for the given repository and ye
|
|
67
67
|
end
|
68
68
|
|
69
69
|
Then(/^I should get a Processing with state "(.*?)"$/) do |state|
|
70
|
-
@response.state.
|
70
|
+
expect(@response.state).to eq(state)
|
71
71
|
end
|
72
72
|
|
73
73
|
Then(/^I should get nil$/) do
|
74
|
-
@response.
|
74
|
+
expect(@response).to be_nil
|
75
75
|
end
|
76
76
|
|
77
77
|
Then(/^I should get "(.*?)"$/) do |state|
|
78
|
-
@response.
|
78
|
+
expect(@response).to eq(state)
|
79
79
|
end
|
80
80
|
|
81
81
|
Then(/^I should get false$/) do
|
82
|
-
@response.
|
82
|
+
expect(@response).to be_falsey
|
83
83
|
end
|
84
84
|
|
85
85
|
Then(/^I should get true$/) do
|
86
|
-
@response.
|
86
|
+
expect(@response).to be_truthy
|
87
87
|
end
|
88
88
|
|
89
89
|
Then(/^I should get a Processing$/) do
|
90
|
-
@response.
|
90
|
+
expect(@response).to be_a(KalibroGem::Entities::Processing)
|
91
91
|
end
|
data/kalibro_gem.gemspec
CHANGED
@@ -36,13 +36,14 @@ Gem::Specification.new do |spec|
|
|
36
36
|
|
37
37
|
spec.add_development_dependency "bundler", "~> 1.3"
|
38
38
|
spec.add_development_dependency "rake"
|
39
|
-
spec.add_development_dependency "rspec", "~>
|
39
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
40
40
|
spec.add_development_dependency "cucumber", "~> 1.3.11"
|
41
41
|
spec.add_development_dependency "mocha", "~> 1.1.0"
|
42
42
|
spec.add_development_dependency "simplecov"
|
43
43
|
spec.add_development_dependency "factory_girl", "~> 4.4.0"
|
44
44
|
spec.add_development_dependency 'coveralls'
|
45
45
|
|
46
|
-
spec.add_dependency "savon", "~> 2.
|
46
|
+
spec.add_dependency "savon", "~> 2.6.0"
|
47
|
+
spec.add_dependency 'rubyntlm', '~> 0.4.0' #necessary by savon >= 2.6.0
|
47
48
|
spec.add_dependency "activesupport", ">= 2.2.1" #version in which underscore was introduced
|
48
49
|
end
|
data/lib/kalibro_gem/version.rb
CHANGED
@@ -27,7 +27,7 @@ describe KalibroGem::Entities::BaseTool do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'should return empty array' do
|
30
|
-
KalibroGem::Entities::BaseTool.all_names.
|
30
|
+
expect(KalibroGem::Entities::BaseTool.all_names).to be_empty
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -45,9 +45,9 @@ describe KalibroGem::Entities::BaseTool do
|
|
45
45
|
it 'should return the two elements' do
|
46
46
|
base_tool_names = KalibroGem::Entities::BaseTool.all_names
|
47
47
|
|
48
|
-
base_tool_names.size.
|
49
|
-
base_tool_names.first.
|
50
|
-
base_tool_names.last.
|
48
|
+
expect(base_tool_names.size).to eq(2)
|
49
|
+
expect(base_tool_names.first).to eq(base_tool_hash)
|
50
|
+
expect(base_tool_names.last).to eq(another_base_tool_hash)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -62,7 +62,7 @@ describe KalibroGem::Entities::BaseTool do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'should return empty array' do
|
65
|
-
KalibroGem::Entities::BaseTool.all_names.
|
65
|
+
expect(KalibroGem::Entities::BaseTool.all_names).to be_empty
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -90,9 +90,9 @@ describe KalibroGem::Entities::BaseTool do
|
|
90
90
|
it 'should return the two elements' do
|
91
91
|
base_tools = KalibroGem::Entities::BaseTool.all
|
92
92
|
|
93
|
-
base_tools.size.
|
94
|
-
base_tools.first.name.
|
95
|
-
base_tools.last.name.
|
93
|
+
expect(base_tools.size).to eq(2)
|
94
|
+
expect(base_tools.first.name).to eq(base_tool.name)
|
95
|
+
expect(base_tools.last.name).to eq(another_base_tool.name)
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -123,7 +123,7 @@ describe KalibroGem::Entities::BaseTool do
|
|
123
123
|
end
|
124
124
|
|
125
125
|
it 'should return a base_tool' do
|
126
|
-
KalibroGem::Entities::BaseTool.find_by_name(subject.name).name.
|
126
|
+
expect(KalibroGem::Entities::BaseTool.find_by_name(subject.name).name).to eq(subject.name)
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
@@ -141,14 +141,14 @@ describe KalibroGem::Entities::BaseTool do
|
|
141
141
|
context 'supported_metric=' do
|
142
142
|
it 'should set the value of the array of supported metrics' do
|
143
143
|
subject.supported_metric = metric.to_hash
|
144
|
-
subject.supported_metric.first.name.
|
144
|
+
expect(subject.supported_metric.first.name).to eq(metric.name)
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
148
|
context 'supported_metrics' do
|
149
149
|
it 'should return the array of the supported metrics' do
|
150
150
|
subject.supported_metric = metric.to_hash
|
151
|
-
subject.supported_metrics.first.name.
|
151
|
+
expect(subject.supported_metrics.first.name).to eq(metric.name)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
@@ -158,11 +158,11 @@ describe KalibroGem::Entities::BaseTool do
|
|
158
158
|
let(:metric) { subject.supported_metrics.first }
|
159
159
|
|
160
160
|
it 'should return nil with an inexistent name' do
|
161
|
-
subject.metric("fake name").
|
161
|
+
expect(subject.metric("fake name")).to be_nil
|
162
162
|
end
|
163
163
|
|
164
164
|
it 'should return a metric with an existent name' do
|
165
|
-
subject.metric(metric.name).name.
|
165
|
+
expect(subject.metric(metric.name).name).to eq(metric.name)
|
166
166
|
end
|
167
167
|
end
|
168
168
|
end
|
@@ -20,7 +20,7 @@ describe KalibroGem::Entities::Configuration do
|
|
20
20
|
describe 'id=' do
|
21
21
|
it 'should set the value of the attribute id as an Integer' do
|
22
22
|
subject.id = "42"
|
23
|
-
subject.id.
|
23
|
+
expect(subject.id).to eq(42)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -34,7 +34,7 @@ describe KalibroGem::Entities::Configuration do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'should return nil' do
|
37
|
-
KalibroGem::Entities::Configuration.all.
|
37
|
+
expect(KalibroGem::Entities::Configuration.all).to be_empty
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -52,9 +52,9 @@ describe KalibroGem::Entities::Configuration do
|
|
52
52
|
it 'should return the two elements' do
|
53
53
|
configurations = KalibroGem::Entities::Configuration.all
|
54
54
|
|
55
|
-
configurations.size.
|
56
|
-
configurations.first.name.
|
57
|
-
configurations.last.name.
|
55
|
+
expect(configurations.size).to eq(2)
|
56
|
+
expect(configurations.first.name).to eq(configuration.name)
|
57
|
+
expect(configurations.last.name).to eq(another_configuration.name)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -22,8 +22,8 @@ describe KalibroGem::Entities::DateMetricResult do
|
|
22
22
|
it 'should set the date and convert it to DateTime' do
|
23
23
|
subject.date = "21/12/1995" # Ruby's first publication
|
24
24
|
|
25
|
-
subject.date.
|
26
|
-
subject.date.
|
25
|
+
expect(subject.date).to be_a(DateTime)
|
26
|
+
expect(subject.date).to eq(DateTime.parse("21/12/1995"))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -31,7 +31,7 @@ describe KalibroGem::Entities::DateMetricResult do
|
|
31
31
|
it 'should just set the value' do
|
32
32
|
subject.date = :something_else
|
33
33
|
|
34
|
-
subject.date.
|
34
|
+
expect(subject.date).to eq(:something_else)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -48,7 +48,7 @@ describe KalibroGem::Entities::DateMetricResult do
|
|
48
48
|
|
49
49
|
it 'should set the metric_result with the given one' do
|
50
50
|
subject.metric_result = metric_result.to_hash
|
51
|
-
subject.metric_result.
|
51
|
+
expect(subject.metric_result).to eq(metric_result)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe KalibroGem::Entities::DateMetricResult do
|
|
56
56
|
subject { FactoryGirl.build(:date_metric_result) }
|
57
57
|
|
58
58
|
it 'should return the metric result value' do
|
59
|
-
subject.result.
|
59
|
+
expect(subject.result).to eq(10)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -22,8 +22,8 @@ describe KalibroGem::Entities::DateModuleResult do
|
|
22
22
|
it 'should set the date and convert it to DateTime' do
|
23
23
|
subject.date = "21/12/1995" # Ruby's first publication
|
24
24
|
|
25
|
-
subject.date.
|
26
|
-
subject.date.
|
25
|
+
expect(subject.date).to be_a(DateTime)
|
26
|
+
expect(subject.date).to eq(DateTime.parse("21/12/1995"))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -31,7 +31,7 @@ describe KalibroGem::Entities::DateModuleResult do
|
|
31
31
|
it 'should just set the value' do
|
32
32
|
subject.date = :something_else
|
33
33
|
|
34
|
-
subject.date.
|
34
|
+
expect(subject.date).to eq(:something_else)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -47,7 +47,7 @@ describe KalibroGem::Entities::DateModuleResult do
|
|
47
47
|
|
48
48
|
it 'should set the module_result with the given one' do
|
49
49
|
subject.module_result = module_result.to_hash
|
50
|
-
subject.module_result.
|
50
|
+
expect(subject.module_result).to eq(module_result)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -55,7 +55,7 @@ describe KalibroGem::Entities::DateModuleResult do
|
|
55
55
|
subject {FactoryGirl.build(:date_module_result)}
|
56
56
|
|
57
57
|
it 'should return the module_result grade' do
|
58
|
-
subject.result.
|
58
|
+
expect(subject.result).to eq(10)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -20,7 +20,7 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
20
20
|
describe 'weight=' do
|
21
21
|
it 'should set the value of the attribute weight' do
|
22
22
|
subject.weight = "0.6"
|
23
|
-
subject.weight.
|
23
|
+
expect(subject.weight).to eq(0.6)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -30,7 +30,7 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
30
30
|
context 'when it is not a hash' do
|
31
31
|
it 'should set the value of the attribute metric' do
|
32
32
|
subject.metric = metric
|
33
|
-
subject.metric.
|
33
|
+
expect(subject.metric).to eq(metric)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -45,7 +45,7 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
45
45
|
|
46
46
|
it 'should set the value of the attribute metric as an object' do
|
47
47
|
subject.metric = metric.to_hash
|
48
|
-
subject.metric.
|
48
|
+
expect(subject.metric).to eq(metric)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -64,7 +64,7 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
64
64
|
|
65
65
|
it 'should set the value of the attribute range' do
|
66
66
|
subject.range = range_snapshot_hash
|
67
|
-
subject.range.
|
67
|
+
expect(subject.range).to eq([range_snapshot])
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -79,9 +79,9 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
79
79
|
it 'should set the value of the attribute range' do
|
80
80
|
subject.range = [range_snapshot_hash, range_snapshot_hash]
|
81
81
|
ranges = subject.range
|
82
|
-
ranges.size.
|
83
|
-
ranges.first.
|
84
|
-
ranges.last.
|
82
|
+
expect(ranges.size).to eq(2)
|
83
|
+
expect(ranges.first).to eq (range_snapshot)
|
84
|
+
expect(ranges.last).to eq (range_snapshot)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -90,7 +90,7 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
90
90
|
subject { FactoryGirl.build(:metric_configuration_snapshot) }
|
91
91
|
|
92
92
|
it 'should return the value of the range attribute' do
|
93
|
-
subject.range_snapshot.
|
93
|
+
expect(subject.range_snapshot).to eq(subject.range)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -99,8 +99,8 @@ describe KalibroGem::Entities::MetricConfigurationSnapshot do
|
|
99
99
|
|
100
100
|
it 'should override the default to_hash method' do
|
101
101
|
hash = subject.to_hash
|
102
|
-
hash[:attributes!][:range].
|
103
|
-
|
102
|
+
expect(hash[:attributes!][:range]).
|
103
|
+
to eq({'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
|
104
104
|
'xsi:type' => 'kalibro:rangeSnapshotXml' })
|
105
105
|
end
|
106
106
|
end
|
@@ -20,14 +20,14 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
20
20
|
describe 'id=' do
|
21
21
|
it 'should set the id as an Integer' do
|
22
22
|
subject.id = "42"
|
23
|
-
subject.id.
|
23
|
+
expect(subject.id).to eq(42)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
describe 'reading_group_id=' do
|
28
28
|
it 'should set the reading group id' do
|
29
29
|
subject.reading_group_id = "1"
|
30
|
-
subject.reading_group_id.
|
30
|
+
expect(subject.reading_group_id).to eq(1)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -43,14 +43,14 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
43
43
|
|
44
44
|
it 'should convert the argument and set the metric' do
|
45
45
|
subject.metric = metric.to_hash
|
46
|
-
subject.metric.
|
46
|
+
expect(subject.metric).to eq(metric)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
describe 'weight=' do
|
51
51
|
it 'should set the weight' do
|
52
52
|
subject.weight = "10"
|
53
|
-
subject.weight.
|
53
|
+
expect(subject.weight).to eq(10)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -65,7 +65,7 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
65
65
|
|
66
66
|
it 'should set the attributes and save' do
|
67
67
|
subject.update_attributes(metric_configuration.to_hash)
|
68
|
-
subject.code.
|
68
|
+
expect(subject.code).to eq(metric_configuration.code)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -73,7 +73,7 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
73
73
|
subject {FactoryGirl.build(:metric_configuration)}
|
74
74
|
|
75
75
|
it 'should not include the configuration_id' do
|
76
|
-
subject.to_hash[:configuration_id].
|
76
|
+
expect(subject.to_hash[:configuration_id]).to be_nil
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -89,8 +89,8 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
89
89
|
end
|
90
90
|
|
91
91
|
it 'should return the metric_configuration' do
|
92
|
-
KalibroGem::Entities::MetricConfiguration.find(metric_configuration.id).
|
93
|
-
id.
|
92
|
+
expect(KalibroGem::Entities::MetricConfiguration.find(metric_configuration.id).
|
93
|
+
id).to eq(metric_configuration.id)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -125,8 +125,8 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
125
125
|
it 'should return a array with a metric configuration' do
|
126
126
|
metric_configurations = KalibroGem::Entities::MetricConfiguration.metric_configurations_of(configuration.id)
|
127
127
|
|
128
|
-
metric_configurations.
|
129
|
-
metric_configurations.first.id.
|
128
|
+
expect(metric_configurations).to be_an(Array)
|
129
|
+
expect(metric_configurations.first.id).to eq(metric_configuration.id)
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
@@ -142,8 +142,8 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
142
142
|
end
|
143
143
|
|
144
144
|
it 'should make a request to save model with id and return true without errors' do
|
145
|
-
subject.save.
|
146
|
-
subject.kalibro_errors.
|
145
|
+
expect(subject.save).to be(true)
|
146
|
+
expect(subject.kalibro_errors).to be_empty
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -156,7 +156,7 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
156
156
|
end
|
157
157
|
|
158
158
|
it 'should return true' do
|
159
|
-
KalibroGem::Entities::MetricConfiguration.exists?(subject.id).
|
159
|
+
expect(KalibroGem::Entities::MetricConfiguration.exists?(subject.id)).to be_truthy
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
@@ -166,7 +166,7 @@ describe KalibroGem::Entities::MetricConfiguration do
|
|
166
166
|
end
|
167
167
|
|
168
168
|
it 'should return false' do
|
169
|
-
KalibroGem::Entities::MetricConfiguration.exists?(subject.id).
|
169
|
+
expect(KalibroGem::Entities::MetricConfiguration.exists?(subject.id)).to be_falsey
|
170
170
|
end
|
171
171
|
end
|
172
172
|
end
|