fix rubocop and tests on stack.rb