Commit 505bff9f0b42b163114e9dff07a5ca9ebc112db7
Exists in
colab
and in
2 other branches
Merge pull request #329 from mezuro/compound_function_scope
Add FUNCTION scope to compound_metric_configuration form
Showing
4 changed files
with
8 additions
and
2 deletions
Show diff stats
app/helpers/compound_metric_configurations_helper.rb
1 | 1 | module CompoundMetricConfigurationsHelper |
2 | 2 | def scope_options |
3 | - [[t("scopes.METHOD"),"METHOD"], [t("scopes.CLASS"), "CLASS"], [t("scopes.PACKAGE"), "PACKAGE"], [t("scopes.SOFTWARE"), "SOFTWARE"]] | |
3 | + %w(FUNCTION METHOD CLASS PACKAGE SOFTWARE).map do |scope| | |
4 | + [t("scopes.#{scope}"), scope] | |
5 | + end | |
4 | 6 | end |
5 | 7 | |
6 | 8 | def compound_metric_human_name(count=1) | ... | ... |
config/locales/views/metric_configurations/en.yml
config/locales/views/metric_configurations/pt.yml
spec/helpers/compound_metric_configurations_helper_spec.rb
... | ... | @@ -3,7 +3,9 @@ require 'rails_helper' |
3 | 3 | describe CompoundMetricConfigurationsHelper, :type => :helper do |
4 | 4 | describe 'scope_options' do |
5 | 5 | it 'should return an array with the supported scope options' do |
6 | - expect(helper.scope_options).to eq [["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"]] | |
6 | + expect(helper.scope_options).to eq [ | |
7 | + ["Function", "FUNCTION"], ["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"] | |
8 | + ] | |
7 | 9 | end |
8 | 10 | end |
9 | 11 | ... | ... |