Sha256: 58de8ae178082f570d67f27b22c768e928c685417860da1f3824ca908c261a53

Contents?: true

Size: 779 Bytes

Versions: 7

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true
Given(/^the smelly file 'smelly.rb'/) do
  contents = <<-EOS.strip_heredoc
    class AllTheMethods
      def method_missing(method, *args, &block)
        message = "I"
        eval "message = ' did not'"
        eval "message << ' exist,'"
        eval "message << ' but now'"
        eval "message << ' I do.'"
        self.class.send(:define_method, method) { "I did not exist, but now I do." }
        self.send(method)
      end
    end
  EOS
  write_file('smelly.rb', contents)
end

Given(/^the clean file 'clean.rb'/) do
  contents = <<-EOS.strip_heredoc
    # Explanatory comment
    class Clean
      def foo; end
    end
  EOS
  write_file('clean.rb', contents)
end

Given(/^the empty file 'empty.rb'/) do
  write_file('clean.rb', '')
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubycritic-3.2.0 features/step_definitions/sample_file_steps.rb
rubycritic-3.1.3 features/step_definitions/sample_file_steps.rb
rubycritic-3.1.2 features/step_definitions/sample_file_steps.rb
rubycritic-3.1.1 features/step_definitions/sample_file_steps.rb
rubycritic-3.1.0 features/step_definitions/sample_file_steps.rb
rubycritic-3.0.0 features/step_definitions/sample_file_steps.rb
rubycritic-2.9.4 features/step_definitions/sample_file_steps.rb