Sha256: 3259f5463b86d612f29f65926d5101fd55d736c60ef777f66c1663cb9f5c7aba

Contents?: true

Size: 1.17 KB

Versions: 43

Compression:

Stored size: 1.17 KB

Contents

Feature: Using Reek programmatically
  In order to use Reek from inside my program
  As a developer
  I want to be able to use its classes

  Scenario: Accessing smells found by an examiner
    Given the smelly file 'smelly.rb'
    And a file named "examine.rb" with:
      """
      require 'reek'
      examiner = Reek::Examiner.new(File.new('smelly.rb'))
      examiner.smells.each do |smell|
        puts smell.message
      end
      """
    When I run `ruby examine.rb`
    Then it reports no errors
    And it reports:
      """
      has the name 'x'
      has the variable name 'y'
      """

  Scenario: Using Reek's built-in report classes
    Given the smelly file 'smelly.rb'
    And a file named "examine.rb" with:
      """
      require 'reek'
      examiner = Reek::Examiner.new(File.new('smelly.rb'))
      report = Reek::Report::TextReport.new
      report.add_examiner examiner
      report.show
      """
    When I run `ruby examine.rb`
    Then it reports no errors
    And it reports:
      """
      smelly.rb -- 2 warnings:
        UncommunicativeMethodName: Smelly#x has the name 'x'
        UncommunicativeVariableName: Smelly#x has the variable name 'y'
      """

Version data entries

43 entries across 41 versions & 2 rubygems

Version Path
reek-6.0.3 features/programmatic_access.feature
reek-6.0.2 features/programmatic_access.feature
reek-6.0.1 features/programmatic_access.feature
reek-6.0.0 features/programmatic_access.feature
reek-5.6.0 features/programmatic_access.feature
reek-5.5.0 features/programmatic_access.feature
reek-5.4.1 features/programmatic_access.feature
reek-5.4.0 features/programmatic_access.feature
reek-5.3.2 features/programmatic_access.feature
reek-5.3.1 features/programmatic_access.feature
reek-5.3.0 features/programmatic_access.feature
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/features/programmatic_access.feature
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/features/programmatic_access.feature
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/features/programmatic_access.feature
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/features/programmatic_access.feature
reek-5.2.0 features/programmatic_access.feature
reek-5.1.0 features/programmatic_access.feature
reek-5.0.2 features/programmatic_access.feature
reek-5.0.1 features/programmatic_access.feature
reek-5.0.0 features/programmatic_access.feature