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