Commit 1daafa6278581d6556d53ce70c27a2de46ada063
1 parent
775afddc
Exists in
colab
and in
4 other branches
Fix KalibroModule factories
KalibroClient now expectes granularity as a hash with key type.
Showing
2 changed files
with
8 additions
and
6 deletions
Show diff stats
app/helpers/kalibro_modules_helper.rb
@@ -17,7 +17,7 @@ module KalibroModulesHelper | @@ -17,7 +17,7 @@ module KalibroModulesHelper | ||
17 | if (a.kalibro_module.granularity == b.kalibro_module.granularity) | 17 | if (a.kalibro_module.granularity == b.kalibro_module.granularity) |
18 | a.kalibro_module.name <=> b.kalibro_module.name | 18 | a.kalibro_module.name <=> b.kalibro_module.name |
19 | else | 19 | else |
20 | - (ComparableGranularity.new(b.kalibro_module.granularity.to_sym) <=> ComparableGranularity.new(a.kalibro_module.granularity.to_sym)) | 20 | + (ComparableGranularity.new(b.kalibro_module.granularity.type) <=> ComparableGranularity.new(a.kalibro_module.granularity.type)) |
21 | end | 21 | end |
22 | end | 22 | end |
23 | end | 23 | end |
spec/factories/kalibro_modules.rb
1 | FactoryGirl.define do | 1 | FactoryGirl.define do |
2 | factory :kalibro_module, class: KalibroClient::Entities::Processor::KalibroModule do | 2 | factory :kalibro_module, class: KalibroClient::Entities::Processor::KalibroModule do |
3 | name 'Qt-Calculator' | 3 | name 'Qt-Calculator' |
4 | - granularity 'SOFTWARE' | 4 | + granularity { {'type' => 'SOFTWARE'} } |
5 | 5 | ||
6 | trait :package do | 6 | trait :package do |
7 | - granularity 'PACKAGE' | 7 | + granularity { {'type' => 'PACKAGE'} } |
8 | end | 8 | end |
9 | 9 | ||
10 | trait :class do | 10 | trait :class do |
11 | - granularity 'CLASS' | 11 | + granularity { {'type' => 'CLASS'} } |
12 | end | 12 | end |
13 | 13 | ||
14 | trait :function do | 14 | trait :function do |
15 | - granularity 'FUNCTION' | 15 | + granularity { {'type' => 'FUNCTION'} } |
16 | end | 16 | end |
17 | 17 | ||
18 | trait :method do | 18 | trait :method do |
19 | - granularity 'METHOD' | 19 | + granularity { {'type' => 'METHOD'} } |
20 | end | 20 | end |
21 | 21 | ||
22 | factory :kalibro_module_package, traits: [:package] | 22 | factory :kalibro_module_package, traits: [:package] |
23 | factory :kalibro_module_class, traits: [:class] | 23 | factory :kalibro_module_class, traits: [:class] |
24 | factory :kalibro_module_function, traits: [:function] | 24 | factory :kalibro_module_function, traits: [:function] |
25 | factory :kalibro_module_method, traits: [:method] | 25 | factory :kalibro_module_method, traits: [:method] |
26 | + | ||
27 | + initialize_with { KalibroClient::Entities::Processor::KalibroModule.new({granularity: granularity, name: name}.stringify_keys) } | ||
26 | end | 28 | end |
27 | end | 29 | end |