Sha256: 8b0c52cd4306b5cf62f00196fac94fd58eb51666b057d58e56016e46cc8c4693

Contents?: true

Size: 1.26 KB

Versions: 19

Compression:

Stored size: 1.26 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 a smelly file called '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:
      """
      calls @foo.bar 2 times
      calls puts @foo.bar 2 times
      has the name 'm'
      """

  Scenario: Using Reek's built-in report classes
    Given a smelly file called '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 -- 3 warnings:
        DuplicateMethodCall: Smelly#m calls @foo.bar 2 times
        DuplicateMethodCall: Smelly#m calls puts @foo.bar 2 times
        UncommunicativeMethodName: Smelly#m has the name 'm'
      """

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
reek-4.2.3 features/programmatic_access.feature
reek-4.2.2 features/programmatic_access.feature
reek-4.2.1 features/programmatic_access.feature
reek-4.2.0 features/programmatic_access.feature
reek-4.1.1 features/programmatic_access.feature
reek-4.1.0 features/programmatic_access.feature
reek-4.0.5 features/programmatic_access.feature
reek-4.0.4 features/programmatic_access.feature
reek-4.0.3 features/programmatic_access.feature
reek-4.0.2 features/programmatic_access.feature
reek-4.0.1 features/programmatic_access.feature
reek-4.0.0 features/programmatic_access.feature
reek-4.0.0.pre1 features/programmatic_access.feature
reek-3.11 features/programmatic_access.feature
reek-3.10.2 features/programmatic_access.feature
reek-3.10.1 features/programmatic_access.feature
reek-3.10.0 features/programmatic_access.feature
reek-3.9.1 features/programmatic_access.feature
reek-3.9.0 features/programmatic_access.feature