Sha256: 5b110433060b328f221413ce31a92cb678ddb236b892f991a39078adf722c313

Contents?: true

Size: 1.8 KB

Versions: 11

Compression:

Stored size: 1.8 KB

Contents

Feature: RubyCritic can be run via Rake task
  In order to allow for a better CI usage
  As a developer
  I want to use RubyCritic as a Rake task

  Scenario: ‘paths' attribute is respected
    Given the smelly file 'smelly.rb'
    When I run rake rubycritic with:
      """
      RubyCritic::RakeTask.new do |t|
        t.paths = FileList['smelly.*']
        t.options = '--no-browser -f console'
      end
      """
    Then the output should contain:
      """
      (HighComplexity) AllTheMethods#method_missing has a flog score of 27
      """
    And the exit status indicates a success

  Scenario: 'name' option changes the task name
    Given the smelly file 'smelly.rb'
    When I run rake silky with:
      """
      RubyCritic::RakeTask.new('silky') do |t|
        t.paths = FileList['smelly.*']
        t.verbose = true
        t.options = '--no-browser'
      end
      """
    Then the output should contain:
      """
      Running `silky` rake command
      """

  Scenario: 'verbose' prints details about the execution
    Given the smelly file 'smelly.rb'
    When I run rake rubycritic with:
      """
      RubyCritic::RakeTask.new do |t|
        t.paths = FileList['smelly.*']
        t.verbose = true
        t.options = '--no-browser'
      end
      """
    Then the output should contain:
      """
      !!! Running `rubycritic` rake command
      !!! Inspecting smelly.rb with options --no-browser
      """

  Scenario: respect --minimum-score
    Given the smelly file 'smelly.rb'
    When I run rake rubycritic with:
      """
      RubyCritic::RakeTask.new do |t|
        t.paths = FileList['smelly.*']
        t.verbose = true
        t.options = '--no-browser -f console --minimum-score 95'
      end
      """
    Then the output should contain:
      """
      Score (93.75) is below the minimum 95
      """

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rubycritic-3.2.3 features/rake_task.feature
rubycritic-3.2.2 features/rake_task.feature
rubycritic-3.2.1 features/rake_task.feature
rubycritic-3.2.0 features/rake_task.feature
rubycritic-3.1.3 features/rake_task.feature
rubycritic-3.1.2 features/rake_task.feature
rubycritic-3.1.1 features/rake_task.feature
rubycritic-3.1.0 features/rake_task.feature
rubycritic-3.0.0 features/rake_task.feature
rubycritic-2.9.4 features/rake_task.feature
rubycritic-2.9.3 features/rake_task.feature