<commit_before>require 'spec_helper'
#Feature: Extract Method :RExtractMethod
#  Extracts the selected code into a new method of its own.

#    Shortcuts:
#      :RExtractMethod
#      <leader>rem

describe "extract method" do
  let(:filename) { 'extract_method.coffee' }
  #  Scenario: Extract one line assignment into a new method
  #    Given I have the following code:
  specify "with params" do
    set_file_contents <<-EOF
class Foo
  method_one: ->
    @bar = foo

  method_two: ->
    one = 1
    two = 2
    three = 3
    four = two + two
    five = two + three
    six = five + one
    EOF
    # When I select "two + three" and execute:
    vim.command 'call CRExtractMethod()'
    # And I fill in the parameter "add"
    vim.feedkeys 'add\<C-R>'<commit_msg>do the corect spec step by step with smal visual delay<commit_after>require 'spec_helper'
#Feature: Extract Method :RExtractMethod
#  Extracts the selected code into a new method of its own.

#    Shortcuts:
#      :RExtractMethod
#      <leader>rem

describe "extract method" do
  let(:filename) { 'extract_method.coffee' }
  #  Scenario: Extract one line assignment into a new method
  #    Given I have the following code:
  specify "with params" do
    set_file_contents <<-EOF
class Foo
  method_one: ->
    @bar = foo

  method_two: ->
    one = 1
    two = 2
    three = 3
    four = two + two
    five = two + three
    six = five + one
    EOF
    # When I select "two + three" and execute:
    # TODO select line helper
    vim.command 'set number'
    vim.command 'hi Visual  guifg=#FFFF00 guibg=#003322 gui=none'
    vim.edit filename
    #vim.insert ''
    vim.feedkeys '\\<esc>'
    sleep 2
    vim.write
    vim.feedkeys '8GVG'
    #vim.command 'call CRExtractMethod()'
    sleep 2
    vim.feedkeys ':call CRExtractMethod()\\<CR>'
    sleep 2
    # And I fill in the parameter "add"
    vim.feedkeys 'add\<CR>'
    sleep 2
{'fraction_non_alphanumeric': 0.09658792650918635, 'fraction_numerical': 0.009973753280839895, 'mean_word_length': 2.6866537717601546, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6940791', 'n_tokens_mistral': 673, 'n_tokens_neox': 620, 'n_words': 217}