7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/side_to_capybara.rb', line 7
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 << " test '\#{name}' do\n \#{test_commands.map {|x| \" \#{x.gsub(/\\n/, \"\\n \")}\"}.join(\"\\n\\n\")}\n end\n EOS\n output << \"\\n# WARNING: Some commands are unhandled. Please contribute here: https://github.com/DarkSwoop/side_to_capybara\" if warning_present\n output.join(\"\\n\")\nend\n"
|