techcor 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -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\\').value.to_s'}" "
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\\').value.to_s'}" "property('Unit Tests Count').value == 1""
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\\').value.to_s'}" "
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\\').value.to_s'}" "property('Unit Tests Count').value == 6""
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\\').value.to_s'}" "property('Unit Tests Count').value == 6 || property('Unit Tests Count').value == 100""
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' => 'value',
22
- 'Changed at' => "last_updated_at.strftime('#{date_format}')",
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(:value)"] }]
21
+ Hash[properties.map { |p| [p, "property('#{p}').try :last_value"] }]
22
22
  end
23
23
 
24
24
  def properties
@@ -5,7 +5,7 @@ class Metric
5
5
  self
6
6
  end
7
7
 
8
- def value
8
+ def last_value
9
9
  values.last.try :value
10
10
  end
11
11
 
@@ -2,7 +2,7 @@ class Techcor
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -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' => 'value',
30
- 'Changed at' => "last_updated_at.strftime('DATE_FORMAT')",
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(:value)",
44
- 'metric2' => "property('metric2').try(:value)",
45
- 'metric3' => "property('metric3').try(:value)"}
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
@@ -9,7 +9,7 @@ describe Metric do
9
9
  it 'returns last value' do
10
10
  value = stub(:value)
11
11
  subject.stub(:values => [stub, stub, stub(:last_value, :value => value)])
12
- subject.value.should == value
12
+ subject.last_value.should == value
13
13
  end
14
14
 
15
15
  it 'returns last updater' do
@@ -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").value >= 2').should have_exactly(2).items
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").value == 2 || property("length").value == 3').should have_exactly(2).items
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
@@ -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).value.should be value
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
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-24 00:00:00.000000000 Z
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: -2673422986978067583
300
+ hash: 3110712612447781352
301
301
  required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  none: false
303
303
  requirements: