techcor 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/features/list_projects.feature +5 -5
- data/lib/commands/describe_project.rb +2 -2
- data/lib/commands/list_projects.rb +1 -1
- data/lib/metrics/metric.rb +1 -1
- data/lib/techcor/version.rb +1 -1
- data/spec/lib/commands/describe_project_spec.rb +2 -2
- data/spec/lib/commands/list_projects_spec.rb +3 -3
- data/spec/lib/metrics/metric_spec.rb +1 -1
- data/spec/lib/project_catalog_spec.rb +2 -2
- data/spec/lib/project_spec.rb +1 -1
- metadata +3 -3
@@ -5,17 +5,17 @@ Feature: Listing projects in console
|
|
5
5
|
|
6
6
|
Scenario: listing empty project catalog with empty criteria
|
7
7
|
Given no projects in catalog
|
8
|
-
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').
|
8
|
+
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').last_value.to_s'}" "
|
9
9
|
Then the cli output should contain "0 rows in set"
|
10
10
|
|
11
11
|
Scenario: listing empty project catalog with specified criteria
|
12
12
|
Given no projects in catalog
|
13
|
-
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').
|
13
|
+
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').last_value.to_s'}" "property('Unit Tests Count').last_value == 1""
|
14
14
|
Then the cli output should contain "0 rows in set"
|
15
15
|
|
16
16
|
Scenario: listing projects catalog with empty criteria
|
17
17
|
Given catalog filled by seeds script
|
18
|
-
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').
|
18
|
+
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').last_value.to_s'}" "
|
19
19
|
Then the cli output should contain:
|
20
20
|
"""
|
21
21
|
+----------+--------------+
|
@@ -29,7 +29,7 @@ Feature: Listing projects in console
|
|
29
29
|
|
30
30
|
Scenario: listing projects catalog with simple criteria
|
31
31
|
Given catalog filled by seeds script
|
32
|
-
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').
|
32
|
+
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').last_value.to_s'}" "property('Unit Tests Count').last_value == 6""
|
33
33
|
Then the cli output should contain:
|
34
34
|
"""
|
35
35
|
+----------+------------+
|
@@ -42,7 +42,7 @@ Feature: Listing projects in console
|
|
42
42
|
|
43
43
|
Scenario: listing projects catalog with complex criteria
|
44
44
|
Given catalog filled by seeds script
|
45
|
-
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').
|
45
|
+
When I execute cli "list --fm "{'Name' => 'name', 'Count' => '\\'Count: \\' + property(\\'Unit Tests Count\\').last_value.to_s'}" "property('Unit Tests Count').last_value == 6 || property('Unit Tests Count').last_value == 100""
|
46
46
|
Then the cli output should contain:
|
47
47
|
"""
|
48
48
|
+----------+--------------+
|
@@ -18,8 +18,8 @@ class DescribeProject < Struct.new :project_name, :date_format
|
|
18
18
|
def format date_format = date_format
|
19
19
|
{
|
20
20
|
'Metric' => 'name',
|
21
|
-
'Value' => '
|
22
|
-
'Changed at' => "last_updated_at.strftime
|
21
|
+
'Value' => 'last_value',
|
22
|
+
'Changed at' => "last_updated_at.try :strftime, '#{date_format}'",
|
23
23
|
'Changed by' => "last_updated_by"
|
24
24
|
}
|
25
25
|
end
|
@@ -18,7 +18,7 @@ class ListProjects < Struct.new :format, :criteria
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def list_properties_format properties
|
21
|
-
Hash[properties.map { |p| [p, "property('#{p}').try
|
21
|
+
Hash[properties.map { |p| [p, "property('#{p}').try :last_value"] }]
|
22
22
|
end
|
23
23
|
|
24
24
|
def properties
|
data/lib/metrics/metric.rb
CHANGED
data/lib/techcor/version.rb
CHANGED
@@ -26,8 +26,8 @@ describe DescribeProject do
|
|
26
26
|
it 'constructs format for console formatter' do
|
27
27
|
subject.format("DATE_FORMAT").should == {
|
28
28
|
'Metric' => 'name',
|
29
|
-
'Value' => '
|
30
|
-
'Changed at' => "last_updated_at.strftime
|
29
|
+
'Value' => 'last_value',
|
30
|
+
'Changed at' => "last_updated_at.try :strftime, 'DATE_FORMAT'",
|
31
31
|
'Changed by' => "last_updated_by"
|
32
32
|
}
|
33
33
|
end
|
@@ -40,8 +40,8 @@ describe ListProjects do
|
|
40
40
|
stub(:metrics => [stub(:name => 'metric1'), stub(:name => 'metric2')]),
|
41
41
|
stub(:metrics => [stub(:name => 'metric3')])])
|
42
42
|
subject.default_format.should == {'Name' => 'name',
|
43
|
-
'metric1' => "property('metric1').try
|
44
|
-
'metric2' => "property('metric2').try
|
45
|
-
'metric3' => "property('metric3').try
|
43
|
+
'metric1' => "property('metric1').try :last_value",
|
44
|
+
'metric2' => "property('metric2').try :last_value",
|
45
|
+
'metric3' => "property('metric3').try :last_value"}
|
46
46
|
end
|
47
47
|
end
|
@@ -10,11 +10,11 @@ describe ProjectCatalog do
|
|
10
10
|
}
|
11
11
|
|
12
12
|
it 'searches projects by simple criteria' do
|
13
|
-
subject.projects('property("length").
|
13
|
+
subject.projects('property("length").last_value >= 2').should have_exactly(2).items
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'searches projects by complex criteria' do
|
17
|
-
subject.projects('property("length").
|
17
|
+
subject.projects('property("length").last_value == 2 || property("length").last_value == 3').should have_exactly(2).items
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'orders projects by name' do
|
data/spec/lib/project_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe Project do
|
|
27
27
|
it 'returns last value of the property history' do
|
28
28
|
value = 'v'
|
29
29
|
subject.edit_property(name, stub, stub).edit_property(name, value, stub)
|
30
|
-
subject.property(name).
|
30
|
+
subject.property(name).last_value.should be value
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: techcor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -297,7 +297,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
297
297
|
version: '0'
|
298
298
|
segments:
|
299
299
|
- 0
|
300
|
-
hash:
|
300
|
+
hash: 3110712612447781352
|
301
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
302
302
|
none: false
|
303
303
|
requirements:
|