Sha256: 33a3952cf394c2994be1e456352319e2fcbc27abbaa3affbe990832cdcadec2d

Contents?: true

Size: 1.8 KB

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
rubycritic-2.9.2 features/rake_task.feature
rubycritic-2.9.1 features/rake_task.feature
rubycritic-2.9.0 features/rake_task.feature
rubycritic-2.8.0 features/rake_task.feature