Sha256: 8b06d0f05afa34950c69a323dff6927853d86842ac235261ecc0b7435ca196e2

Contents?: true

Size: 852 Bytes

Versions: 1

Compression:

Stored size: 852 Bytes

Contents

require "side_to_capybara/version"
require 'side_to_capybara/base'
require 'side_to_capybara/minitest'

warn "[DEPRECATION] This gem has been renamed to selenium_to_capybara and will no longer be supported. Please switch to selenium_to_capybara as soon as possible."

module SideToCapybara

  def self.to_minitest(name, commands)
    test_commands = commands.map do |command|
      Minitest.new(command).translate
    end

    warning_present = test_commands.any? {|translation| translation.start_with?('# WARNING:')}

    output = []
    output << <<~EOS
      test '#{name}' do
      #{test_commands.map {|x| "  #{x.gsub(/\n/, "\n  ")}"}.join("\n\n")}
      end
    EOS
    output << "\n# WARNING: Some commands are unhandled. Please contribute here: https://github.com/DarkSwoop/side_to_capybara" if warning_present
    output.join("\n")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
side_to_capybara-0.1.3 lib/side_to_capybara.rb