diff --git a/lib/config/cucumber-java.conf b/lib/config/cucumber-java.conf index 3ac50370..4066cb24 100644 --- a/lib/config/cucumber-java.conf +++ b/lib/config/cucumber-java.conf @@ -5,20 +5,21 @@ fallback_template = 'empty' [features] node_name = folders -template_dirs = gherkin/inlined_uids, gherkin/java, gherkin, common +template_dirs = gherkin, common +gherkin_flavors = inlined_uids, no_empty_scenarios named_filename = '%s.feature' indentation = ' ' renderer_addons = 'GherkinAddon' [step_definitions] node_name = actionwords -template_dirs = cucumber/java, java, common +template_dirs = cucumber-java, java, common filename = 'StepDefinitions.java' naming_convention = 'camelize_lower' call_prefix = 'actionwords' renderer_addons = 'GherkinAddon' [actionwords] -template_dirs = cucumber/java/actionwords, java, common +template_dirs = cucumber-java, java, common filename = 'Actionwords.java' naming_convention = 'camelize_lower' diff --git a/lib/config/cucumber-ruby.conf b/lib/config/cucumber-ruby.conf index 21776495..7a299912 100644 --- a/lib/config/cucumber-ruby.conf +++ b/lib/config/cucumber-ruby.conf @@ -11,7 +11,7 @@ renderer_addons = 'GherkinAddon' [step_definitions] node_name = actionwords -template_dirs = cucumber, common +template_dirs = cucumber-ruby, common filename = 'step_definitions.rb' naming_convention = 'underscore' renderer_addons = 'GherkinAddon' diff --git a/lib/config/python-unittest.conf b/lib/config/python-unittest.conf index d12de19a..c250efeb 100644 --- a/lib/config/python-unittest.conf +++ b/lib/config/python-unittest.conf @@ -1,5 +1,5 @@ [_common] -template_dirs = python/unittest, python, common +template_dirs = python-unittest, python, common indentation = " " [tests] diff --git a/lib/config/ruby-minitest.conf b/lib/config/ruby-minitest.conf index 242262c1..92a642e8 100644 --- a/lib/config/ruby-minitest.conf +++ b/lib/config/ruby-minitest.conf @@ -1,5 +1,5 @@ [_common] -template_dirs = ruby/minitest, ruby, common +template_dirs = minitest, ruby, common [tests] filename = 'project_test.rb' diff --git a/lib/config/ruby-rspec.conf b/lib/config/ruby-rspec.conf index 88006f2b..99e9a088 100644 --- a/lib/config/ruby-rspec.conf +++ b/lib/config/ruby-rspec.conf @@ -1,5 +1,5 @@ [_common] -template_dirs = ruby, common +template_dirs = rspec, ruby, common [tests] filename = 'project_spec.rb' diff --git a/lib/hiptest-publisher/options_parser.rb b/lib/hiptest-publisher/options_parser.rb index 5820bdd6..439cfa90 100644 --- a/lib/hiptest-publisher/options_parser.rb +++ b/lib/hiptest-publisher/options_parser.rb @@ -8,8 +8,8 @@ require 'hiptest-publisher/formatters/console_formatter' require 'hiptest-publisher/renderer_addons' +require 'hiptest-publisher/template_finder' require 'hiptest-publisher/utils' -require 'hiptest-publisher/handlebars_helper' class FileConfigParser @@ -359,87 +359,6 @@ def renderer_addons end end -class TemplateFinder - attr_reader :template_dirs, :overriden_templates, :forced_templates, :fallback_template - - def initialize( - template_dirs: nil, - overriden_templates: nil, - indentation: ' ', - forced_templates: nil, - fallback_template: nil, - **) - @template_dirs = template_dirs || [] - @overriden_templates = overriden_templates - @compiled_handlebars = {} - @template_path_by_name = {} - @forced_templates = forced_templates || {} - @fallback_template = fallback_template - @context = {indentation: indentation} - end - - def dirs - @dirs ||= begin - search_dirs = [] - # search in overriden template base dir first - search_dirs << overriden_templates if overriden_templates - template_dirs.each {|template_dir| - # search template paths in overriden_templates - search_dirs << "#{overriden_templates}/#{template_dir}" if overriden_templates - # search template paths in hiptest_publisher - search_dirs << "#{hiptest_publisher_path}/lib/templates/#{template_dir}" - } - search_dirs - end - end - - def get_compiled_handlebars(template_name) - template_path = get_template_path(template_name) - @compiled_handlebars[template_path] ||= handlebars.compile(File.read(template_path)) - end - - def get_template_by_name(name) - return if name.nil? - name = forced_templates.fetch(name, name) - dirs.each do |path| - template_path = File.join(path, "#{name}.hbs") - return template_path if File.file?(template_path) - end - nil - end - - def get_template_path(template_name) - unless @template_path_by_name.has_key?(template_name) - @template_path_by_name[template_name] = get_template_by_name(template_name) || get_template_by_name(@fallback_template) - end - @template_path_by_name[template_name] or raise ArgumentError.new(I18n.t('errors.template_not_found', template_name: template_name, dirs: dirs)) - end - - def register_partials - dirs.reverse_each do |path| - next unless File.directory?(path) - Dir.entries(path).select do |file_name| - file_path = File.join(path, file_name) - next unless File.file?(file_path) && file_name.start_with?('_') - @handlebars.register_partial(file_name[1..-5], File.read(file_path)) - end - end - end - - private - - def handlebars - if !@handlebars - @handlebars = Handlebars::Handlebars.new - @handlebars.set_escaper(Handlebars::Escapers::DummyEscaper) - - register_partials - Hiptest::HandlebarsHelper.register_helpers(@handlebars, @context) - end - @handlebars - end -end - class LanguageGroupConfig @@MAX_FILE_SIZE = 255 @@ -526,14 +445,33 @@ def template_dirs end end + def template_flavors + specified_flavors = {} + + template_dirs.each do |template_dir| + flavor_name = "#{template_dir}_flavors".to_sym + flavors = @language_group_params[flavor_name] + + next if flavors.nil? + specified_flavors[flavor_name] = flavors.split(',').map(&:strip) + end + + specified_flavors + end + def template_finder - @template_finder ||= TemplateFinder.new( + @template_finder ||= TemplateFinder.new(template_finder_create_opts) + end + + def template_finder_create_opts + opts = { template_dirs: template_dirs, overriden_templates: @language_group_params[:overriden_templates], indentation: indentation, forced_templates: forced_templates, fallback_template: @language_group_params[:fallback_template], - ) + language_group: @language_group_params[:group_name] + }.merge(template_flavors) end def each_node_rendering_context(project) diff --git a/lib/hiptest-publisher/template_finder.rb b/lib/hiptest-publisher/template_finder.rb new file mode 100644 index 00000000..c1f60fe9 --- /dev/null +++ b/lib/hiptest-publisher/template_finder.rb @@ -0,0 +1,150 @@ +require 'i18n' + +require 'hiptest-publisher/handlebars_helper' + +class TemplateFinder + attr_reader :template_dirs, :overriden_templates, :forced_templates, :fallback_template + + def initialize( + template_dirs: nil, + overriden_templates: nil, + indentation: ' ', + forced_templates: nil, + fallback_template: nil, + language_group: nil, + **extra) + @template_dirs = template_dirs || [] + @overriden_templates = overriden_templates + @compiled_handlebars = {} + @template_path_by_name = {} + @forced_templates = forced_templates || {} + @fallback_template = fallback_template + @language_group = language_group + @extra_params = extra + + @context = {indentation: indentation} + end + + def dirs + @dirs ||= begin + search_dirs = [] + # search in overriden template base dir first + search_dirs << overriden_templates if overriden_templates + template_dirs.each do |template_dir| + # search template paths in overriden_templates + search_dirs << "#{overriden_templates}/#{template_dir}" if overriden_templates + version = required_version(template_dir) + flavors = @extra_params["#{template_dir}_flavors".to_sym] || [] + + # Search for templates/languages//version- + if languages_dirs.has_key?(template_dir) + language_dir = "#{hiptest_publisher_path}/lib/templates/languages/#{template_dir}/#{find_version(languages_dirs[template_dir], version)}" + + if @language_group && File.directory?(File.join(language_dir, @language_group)) + search_dirs << "#{language_dir}/#{@language_group}" + end + + flavors.each do |flavor| + flavor_dir_name = "#{flavor}_flavor" + if File.directory?(File.join(language_dir, flavor_dir_name)) + search_dirs << "#{language_dir}/#{flavor_dir_name}" + end + end + + search_dirs << language_dir + # Search for templates/frameworks//version- + elsif framework_dirs.has_key?(template_dir) + framework_dir = "#{hiptest_publisher_path}/lib/templates/frameworks/#{template_dir}/#{find_version(framework_dirs[template_dir], version)}" + if @language_group && File.directory?(File.join(framework_dir, @language_group)) + search_dirs << "#{framework_dir}/#{@language_group}" + end + + search_dirs << framework_dir + else + # Support old location for templates and "common" folder + search_dirs << "#{hiptest_publisher_path}/lib/templates/#{template_dir}/" + end + end + + search_dirs + end + end + + def required_version(template_dir) + required = @extra_params["#{template_dir}_version".to_sym] + required ? "version-#{required}" : nil + end + + def find_version(versions, version) + versions.include?(version) ? version : versions.first + end + + def get_compiled_handlebars(template_name) + template_path = get_template_path(template_name) + @compiled_handlebars[template_path] ||= handlebars.compile(File.read(template_path)) + end + + def get_template_path(template_name) + unless @template_path_by_name.has_key?(template_name) + @template_path_by_name[template_name] = get_template_by_name(template_name) || get_template_by_name(@fallback_template) + end + @template_path_by_name[template_name] or raise ArgumentError.new(I18n.t('errors.template_not_found', template_name: template_name, dirs: dirs)) + end + + def get_template_by_name(name) + return if name.nil? + name = forced_templates.fetch(name, name) + dirs.each do |path| + template_path = File.join(path, "#{name}.hbs") + return template_path if File.file?(template_path) + end + nil + end + + def register_partials + dirs.reverse_each do |path| + next unless File.directory?(path) + Dir.entries(path).select do |file_name| + file_path = File.join(path, file_name) + next unless File.file?(file_path) && file_name.start_with?('_') + @handlebars.register_partial(file_name[1..-5], File.read(file_path)) + end + end + end + + private + + def languages_dirs + @languages_dirs ||= two_levels_hierarchy('languages') + end + + def framework_dirs + @framework_dirs ||= two_levels_hierarchy('frameworks') + end + + def two_levels_hierarchy(path) + hierarchy = {} + list_directories(path).map do |first_level| + hierarchy[first_level] = list_directories("#{path}/#{first_level}") + end + hierarchy + end + + def list_directories(path) + Dir. + entries("#{hiptest_publisher_path}/lib/templates/#{path}") + .select {|entry| File.directory? File.join("#{hiptest_publisher_path}/lib/templates/#{path}", entry) and !(entry =='.' || entry == '..') } + .sort + end + + def handlebars + if !@handlebars + @handlebars = Handlebars::Handlebars.new + @handlebars.set_escaper(Handlebars::Escapers::DummyEscaper) + + register_partials + Hiptest::HandlebarsHelper.register_helpers(@handlebars, @context) + end + @handlebars + end +end diff --git a/lib/templates/cucumber/groovy/step-definitions/parameter.hbs b/lib/templates/frameworks/cucumber-java/version-1.2/actionwords/parameter.hbs similarity index 100% rename from lib/templates/cucumber/groovy/step-definitions/parameter.hbs rename to lib/templates/frameworks/cucumber-java/version-1.2/actionwords/parameter.hbs diff --git a/lib/templates/cucumber/java/actionword.hbs b/lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/actionword.hbs similarity index 100% rename from lib/templates/cucumber/java/actionword.hbs rename to lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/actionword.hbs diff --git a/lib/templates/cucumber/java/actionwords.hbs b/lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/actionwords.hbs similarity index 100% rename from lib/templates/cucumber/java/actionwords.hbs rename to lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/actionwords.hbs diff --git a/lib/templates/cucumber/java/actionwords/parameter.hbs b/lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/parameter.hbs similarity index 100% rename from lib/templates/cucumber/java/actionwords/parameter.hbs rename to lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/parameter.hbs diff --git a/lib/templates/cucumber/actionword.hbs b/lib/templates/frameworks/cucumber-ruby/version-2.1/actionword.hbs similarity index 100% rename from lib/templates/cucumber/actionword.hbs rename to lib/templates/frameworks/cucumber-ruby/version-2.1/actionword.hbs diff --git a/lib/templates/cucumber/actionwords.hbs b/lib/templates/frameworks/cucumber-ruby/version-2.1/actionwords.hbs similarity index 100% rename from lib/templates/cucumber/actionwords.hbs rename to lib/templates/frameworks/cucumber-ruby/version-2.1/actionwords.hbs diff --git a/lib/templates/cucumber/parameter.hbs b/lib/templates/frameworks/cucumber-ruby/version-2.1/parameter.hbs similarity index 100% rename from lib/templates/cucumber/parameter.hbs rename to lib/templates/frameworks/cucumber-ruby/version-2.1/parameter.hbs diff --git a/lib/templates/ruby/_item_as_def.hbs b/lib/templates/frameworks/minitest/version-5.0/_item_as_def.hbs similarity index 100% rename from lib/templates/ruby/_item_as_def.hbs rename to lib/templates/frameworks/minitest/version-5.0/_item_as_def.hbs diff --git a/lib/templates/ruby/minitest/_scenario.hbs b/lib/templates/frameworks/minitest/version-5.0/_scenario.hbs similarity index 100% rename from lib/templates/ruby/minitest/_scenario.hbs rename to lib/templates/frameworks/minitest/version-5.0/_scenario.hbs diff --git a/lib/templates/ruby/minitest/dataset.hbs b/lib/templates/frameworks/minitest/version-5.0/dataset.hbs similarity index 100% rename from lib/templates/ruby/minitest/dataset.hbs rename to lib/templates/frameworks/minitest/version-5.0/dataset.hbs diff --git a/lib/templates/ruby/minitest/folder.hbs b/lib/templates/frameworks/minitest/version-5.0/folder.hbs similarity index 100% rename from lib/templates/ruby/minitest/folder.hbs rename to lib/templates/frameworks/minitest/version-5.0/folder.hbs diff --git a/lib/templates/csharp/scenario.hbs b/lib/templates/frameworks/minitest/version-5.0/scenario.hbs similarity index 100% rename from lib/templates/csharp/scenario.hbs rename to lib/templates/frameworks/minitest/version-5.0/scenario.hbs diff --git a/lib/templates/ruby/minitest/scenarios.hbs b/lib/templates/frameworks/minitest/version-5.0/scenarios.hbs similarity index 100% rename from lib/templates/ruby/minitest/scenarios.hbs rename to lib/templates/frameworks/minitest/version-5.0/scenarios.hbs diff --git a/lib/templates/ruby/minitest/single_scenario.hbs b/lib/templates/frameworks/minitest/version-5.0/single_scenario.hbs similarity index 100% rename from lib/templates/ruby/minitest/single_scenario.hbs rename to lib/templates/frameworks/minitest/version-5.0/single_scenario.hbs diff --git a/lib/templates/ruby/minitest/single_test.hbs b/lib/templates/frameworks/minitest/version-5.0/single_test.hbs similarity index 100% rename from lib/templates/ruby/minitest/single_test.hbs rename to lib/templates/frameworks/minitest/version-5.0/single_test.hbs diff --git a/lib/templates/csharp/test.hbs b/lib/templates/frameworks/minitest/version-5.0/test.hbs similarity index 100% rename from lib/templates/csharp/test.hbs rename to lib/templates/frameworks/minitest/version-5.0/test.hbs diff --git a/lib/templates/ruby/minitest/tests.hbs b/lib/templates/frameworks/minitest/version-5.0/tests.hbs similarity index 100% rename from lib/templates/ruby/minitest/tests.hbs rename to lib/templates/frameworks/minitest/version-5.0/tests.hbs diff --git a/lib/templates/python/_scenario.hbs b/lib/templates/frameworks/python-unittest/version-2.7/_scenario.hbs similarity index 100% rename from lib/templates/python/_scenario.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/_scenario.hbs diff --git a/lib/templates/python/unittest/actionwords.hbs b/lib/templates/frameworks/python-unittest/version-2.7/actionwords.hbs similarity index 100% rename from lib/templates/python/unittest/actionwords.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/actionwords.hbs diff --git a/lib/templates/python/dataset.hbs b/lib/templates/frameworks/python-unittest/version-2.7/dataset.hbs similarity index 100% rename from lib/templates/python/dataset.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/dataset.hbs diff --git a/lib/templates/python/folder.hbs b/lib/templates/frameworks/python-unittest/version-2.7/folder.hbs similarity index 100% rename from lib/templates/python/folder.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/folder.hbs diff --git a/lib/templates/groovy/scenario.hbs b/lib/templates/frameworks/python-unittest/version-2.7/scenario.hbs similarity index 100% rename from lib/templates/groovy/scenario.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/scenario.hbs diff --git a/lib/templates/python/scenarios.hbs b/lib/templates/frameworks/python-unittest/version-2.7/scenarios.hbs similarity index 100% rename from lib/templates/python/scenarios.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/scenarios.hbs diff --git a/lib/templates/python/single_scenario.hbs b/lib/templates/frameworks/python-unittest/version-2.7/single_scenario.hbs similarity index 100% rename from lib/templates/python/single_scenario.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/single_scenario.hbs diff --git a/lib/templates/python/single_test.hbs b/lib/templates/frameworks/python-unittest/version-2.7/single_test.hbs similarity index 100% rename from lib/templates/python/single_test.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/single_test.hbs diff --git a/lib/templates/java/test.hbs b/lib/templates/frameworks/python-unittest/version-2.7/test.hbs similarity index 100% rename from lib/templates/java/test.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/test.hbs diff --git a/lib/templates/python/tests.hbs b/lib/templates/frameworks/python-unittest/version-2.7/tests.hbs similarity index 100% rename from lib/templates/python/tests.hbs rename to lib/templates/frameworks/python-unittest/version-2.7/tests.hbs diff --git a/lib/templates/ruby/_scenario.hbs b/lib/templates/frameworks/rspec/version-3.4/_scenario.hbs similarity index 100% rename from lib/templates/ruby/_scenario.hbs rename to lib/templates/frameworks/rspec/version-3.4/_scenario.hbs diff --git a/lib/templates/ruby/dataset.hbs b/lib/templates/frameworks/rspec/version-3.4/dataset.hbs similarity index 100% rename from lib/templates/ruby/dataset.hbs rename to lib/templates/frameworks/rspec/version-3.4/dataset.hbs diff --git a/lib/templates/ruby/folder.hbs b/lib/templates/frameworks/rspec/version-3.4/folder.hbs similarity index 100% rename from lib/templates/ruby/folder.hbs rename to lib/templates/frameworks/rspec/version-3.4/folder.hbs diff --git a/lib/templates/java/scenario.hbs b/lib/templates/frameworks/rspec/version-3.4/scenario.hbs similarity index 100% rename from lib/templates/java/scenario.hbs rename to lib/templates/frameworks/rspec/version-3.4/scenario.hbs diff --git a/lib/templates/ruby/scenarios.hbs b/lib/templates/frameworks/rspec/version-3.4/scenarios.hbs similarity index 100% rename from lib/templates/ruby/scenarios.hbs rename to lib/templates/frameworks/rspec/version-3.4/scenarios.hbs diff --git a/lib/templates/ruby/single_scenario.hbs b/lib/templates/frameworks/rspec/version-3.4/single_scenario.hbs similarity index 100% rename from lib/templates/ruby/single_scenario.hbs rename to lib/templates/frameworks/rspec/version-3.4/single_scenario.hbs diff --git a/lib/templates/ruby/single_test.hbs b/lib/templates/frameworks/rspec/version-3.4/single_test.hbs similarity index 100% rename from lib/templates/ruby/single_test.hbs rename to lib/templates/frameworks/rspec/version-3.4/single_test.hbs diff --git a/lib/templates/javascript/test.hbs b/lib/templates/frameworks/rspec/version-3.4/test.hbs similarity index 100% rename from lib/templates/javascript/test.hbs rename to lib/templates/frameworks/rspec/version-3.4/test.hbs diff --git a/lib/templates/ruby/tests.hbs b/lib/templates/frameworks/rspec/version-3.4/tests.hbs similarity index 100% rename from lib/templates/ruby/tests.hbs rename to lib/templates/frameworks/rspec/version-3.4/tests.hbs diff --git a/lib/templates/gherkin/_call.hbs b/lib/templates/languages/gherkin/version-3.0/_call.hbs similarity index 100% rename from lib/templates/gherkin/_call.hbs rename to lib/templates/languages/gherkin/version-3.0/_call.hbs diff --git a/lib/templates/gherkin/_gherkin_text.hbs b/lib/templates/languages/gherkin/version-3.0/_gherkin_text.hbs similarity index 100% rename from lib/templates/gherkin/_gherkin_text.hbs rename to lib/templates/languages/gherkin/version-3.0/_gherkin_text.hbs diff --git a/lib/templates/gherkin/_scenario.hbs b/lib/templates/languages/gherkin/version-3.0/_scenario.hbs similarity index 100% rename from lib/templates/gherkin/_scenario.hbs rename to lib/templates/languages/gherkin/version-3.0/_scenario.hbs diff --git a/lib/templates/gherkin/_scenario_outline_title.hbs b/lib/templates/languages/gherkin/version-3.0/_scenario_outline_title.hbs similarity index 100% rename from lib/templates/gherkin/_scenario_outline_title.hbs rename to lib/templates/languages/gherkin/version-3.0/_scenario_outline_title.hbs diff --git a/lib/templates/gherkin/argument.hbs b/lib/templates/languages/gherkin/version-3.0/argument.hbs similarity index 100% rename from lib/templates/gherkin/argument.hbs rename to lib/templates/languages/gherkin/version-3.0/argument.hbs diff --git a/lib/templates/gherkin/call.hbs b/lib/templates/languages/gherkin/version-3.0/call.hbs similarity index 100% rename from lib/templates/gherkin/call.hbs rename to lib/templates/languages/gherkin/version-3.0/call.hbs diff --git a/lib/templates/gherkin/dataset.hbs b/lib/templates/languages/gherkin/version-3.0/dataset.hbs similarity index 100% rename from lib/templates/gherkin/dataset.hbs rename to lib/templates/languages/gherkin/version-3.0/dataset.hbs diff --git a/lib/templates/gherkin/datatable.hbs b/lib/templates/languages/gherkin/version-3.0/datatable.hbs similarity index 100% rename from lib/templates/gherkin/datatable.hbs rename to lib/templates/languages/gherkin/version-3.0/datatable.hbs diff --git a/lib/templates/gherkin/folder.hbs b/lib/templates/languages/gherkin/version-3.0/folder.hbs similarity index 100% rename from lib/templates/gherkin/folder.hbs rename to lib/templates/languages/gherkin/version-3.0/folder.hbs diff --git a/lib/templates/gherkin/inlined_uids/_scenario_outline_title.hbs b/lib/templates/languages/gherkin/version-3.0/inlined_uids_flavor/_scenario_outline_title.hbs similarity index 100% rename from lib/templates/gherkin/inlined_uids/_scenario_outline_title.hbs rename to lib/templates/languages/gherkin/version-3.0/inlined_uids_flavor/_scenario_outline_title.hbs diff --git a/lib/templates/gherkin/java/single_scenario.hbs b/lib/templates/languages/gherkin/version-3.0/no_empty_scenarios_flavor/single_scenario.hbs similarity index 100% rename from lib/templates/gherkin/java/single_scenario.hbs rename to lib/templates/languages/gherkin/version-3.0/no_empty_scenarios_flavor/single_scenario.hbs diff --git a/lib/templates/gherkin/parameter.hbs b/lib/templates/languages/gherkin/version-3.0/parameter.hbs similarity index 100% rename from lib/templates/gherkin/parameter.hbs rename to lib/templates/languages/gherkin/version-3.0/parameter.hbs diff --git a/lib/templates/gherkin/scenarios.hbs b/lib/templates/languages/gherkin/version-3.0/scenarios.hbs similarity index 100% rename from lib/templates/gherkin/scenarios.hbs rename to lib/templates/languages/gherkin/version-3.0/scenarios.hbs diff --git a/lib/templates/gherkin/single_scenario.hbs b/lib/templates/languages/gherkin/version-3.0/single_scenario.hbs similarity index 100% rename from lib/templates/gherkin/single_scenario.hbs rename to lib/templates/languages/gherkin/version-3.0/single_scenario.hbs diff --git a/lib/templates/gherkin/single_test.hbs b/lib/templates/languages/gherkin/version-3.0/single_test.hbs similarity index 100% rename from lib/templates/gherkin/single_test.hbs rename to lib/templates/languages/gherkin/version-3.0/single_test.hbs diff --git a/lib/templates/gherkin/step.hbs b/lib/templates/languages/gherkin/version-3.0/step.hbs similarity index 100% rename from lib/templates/gherkin/step.hbs rename to lib/templates/languages/gherkin/version-3.0/step.hbs diff --git a/lib/templates/gherkin/stringliteral.hbs b/lib/templates/languages/gherkin/version-3.0/stringliteral.hbs similarity index 100% rename from lib/templates/gherkin/stringliteral.hbs rename to lib/templates/languages/gherkin/version-3.0/stringliteral.hbs diff --git a/lib/templates/gherkin/tag.hbs b/lib/templates/languages/gherkin/version-3.0/tag.hbs similarity index 100% rename from lib/templates/gherkin/tag.hbs rename to lib/templates/languages/gherkin/version-3.0/tag.hbs diff --git a/lib/templates/gherkin/template.hbs b/lib/templates/languages/gherkin/version-3.0/template.hbs similarity index 100% rename from lib/templates/gherkin/template.hbs rename to lib/templates/languages/gherkin/version-3.0/template.hbs diff --git a/lib/templates/java/_body.hbs b/lib/templates/languages/java/version-7/_body.hbs similarity index 100% rename from lib/templates/java/_body.hbs rename to lib/templates/languages/java/version-7/_body.hbs diff --git a/lib/templates/java/_item_as_function.hbs b/lib/templates/languages/java/version-7/_item_as_function.hbs similarity index 100% rename from lib/templates/java/_item_as_function.hbs rename to lib/templates/languages/java/version-7/_item_as_function.hbs diff --git a/lib/templates/csharp/actionword.hbs b/lib/templates/languages/java/version-7/actionword.hbs similarity index 100% rename from lib/templates/csharp/actionword.hbs rename to lib/templates/languages/java/version-7/actionword.hbs diff --git a/lib/templates/java/actionwords.hbs b/lib/templates/languages/java/version-7/actionwords.hbs similarity index 100% rename from lib/templates/java/actionwords.hbs rename to lib/templates/languages/java/version-7/actionwords.hbs diff --git a/lib/templates/csharp/argument.hbs b/lib/templates/languages/java/version-7/argument.hbs similarity index 100% rename from lib/templates/csharp/argument.hbs rename to lib/templates/languages/java/version-7/argument.hbs diff --git a/lib/templates/csharp/assign.hbs b/lib/templates/languages/java/version-7/assign.hbs similarity index 100% rename from lib/templates/csharp/assign.hbs rename to lib/templates/languages/java/version-7/assign.hbs diff --git a/lib/templates/csharp/binaryexpression.hbs b/lib/templates/languages/java/version-7/binaryexpression.hbs similarity index 100% rename from lib/templates/csharp/binaryexpression.hbs rename to lib/templates/languages/java/version-7/binaryexpression.hbs diff --git a/lib/templates/java/call.hbs b/lib/templates/languages/java/version-7/call.hbs similarity index 100% rename from lib/templates/java/call.hbs rename to lib/templates/languages/java/version-7/call.hbs diff --git a/lib/templates/java/dataset.hbs b/lib/templates/languages/java/version-7/dataset.hbs similarity index 100% rename from lib/templates/java/dataset.hbs rename to lib/templates/languages/java/version-7/dataset.hbs diff --git a/lib/templates/java/dict.hbs b/lib/templates/languages/java/version-7/dict.hbs similarity index 100% rename from lib/templates/java/dict.hbs rename to lib/templates/languages/java/version-7/dict.hbs diff --git a/lib/templates/csharp/field.hbs b/lib/templates/languages/java/version-7/field.hbs similarity index 100% rename from lib/templates/csharp/field.hbs rename to lib/templates/languages/java/version-7/field.hbs diff --git a/lib/templates/csharp/ifthen.hbs b/lib/templates/languages/java/version-7/ifthen.hbs similarity index 100% rename from lib/templates/csharp/ifthen.hbs rename to lib/templates/languages/java/version-7/ifthen.hbs diff --git a/lib/templates/java/index.hbs b/lib/templates/languages/java/version-7/index.hbs similarity index 100% rename from lib/templates/java/index.hbs rename to lib/templates/languages/java/version-7/index.hbs diff --git a/lib/templates/java/libraries.hbs b/lib/templates/languages/java/version-7/libraries.hbs similarity index 100% rename from lib/templates/java/libraries.hbs rename to lib/templates/languages/java/version-7/libraries.hbs diff --git a/lib/templates/java/library.hbs b/lib/templates/languages/java/version-7/library.hbs similarity index 100% rename from lib/templates/java/library.hbs rename to lib/templates/languages/java/version-7/library.hbs diff --git a/lib/templates/java/libraryactionword.hbs b/lib/templates/languages/java/version-7/libraryactionword.hbs similarity index 100% rename from lib/templates/java/libraryactionword.hbs rename to lib/templates/languages/java/version-7/libraryactionword.hbs diff --git a/lib/templates/java/list.hbs b/lib/templates/languages/java/version-7/list.hbs similarity index 100% rename from lib/templates/java/list.hbs rename to lib/templates/languages/java/version-7/list.hbs diff --git a/lib/templates/csharp/nullliteral.hbs b/lib/templates/languages/java/version-7/nullliteral.hbs similarity index 100% rename from lib/templates/csharp/nullliteral.hbs rename to lib/templates/languages/java/version-7/nullliteral.hbs diff --git a/lib/templates/java/parameter.hbs b/lib/templates/languages/java/version-7/parameter.hbs similarity index 100% rename from lib/templates/java/parameter.hbs rename to lib/templates/languages/java/version-7/parameter.hbs diff --git a/lib/templates/csharp/parenthesis.hbs b/lib/templates/languages/java/version-7/parenthesis.hbs similarity index 100% rename from lib/templates/csharp/parenthesis.hbs rename to lib/templates/languages/java/version-7/parenthesis.hbs diff --git a/lib/templates/groovy/property.hbs b/lib/templates/languages/java/version-7/property.hbs similarity index 100% rename from lib/templates/groovy/property.hbs rename to lib/templates/languages/java/version-7/property.hbs diff --git a/lib/templates/csharp/step.hbs b/lib/templates/languages/java/version-7/step.hbs similarity index 100% rename from lib/templates/csharp/step.hbs rename to lib/templates/languages/java/version-7/step.hbs diff --git a/lib/templates/csharp/stringliteral.hbs b/lib/templates/languages/java/version-7/stringliteral.hbs similarity index 100% rename from lib/templates/csharp/stringliteral.hbs rename to lib/templates/languages/java/version-7/stringliteral.hbs diff --git a/lib/templates/csharp/tag.hbs b/lib/templates/languages/java/version-7/tag.hbs similarity index 100% rename from lib/templates/csharp/tag.hbs rename to lib/templates/languages/java/version-7/tag.hbs diff --git a/lib/templates/java/template.hbs b/lib/templates/languages/java/version-7/template.hbs similarity index 100% rename from lib/templates/java/template.hbs rename to lib/templates/languages/java/version-7/template.hbs diff --git a/lib/templates/csharp/variable.hbs b/lib/templates/languages/java/version-7/variable.hbs similarity index 100% rename from lib/templates/csharp/variable.hbs rename to lib/templates/languages/java/version-7/variable.hbs diff --git a/lib/templates/csharp/while.hbs b/lib/templates/languages/java/version-7/while.hbs similarity index 100% rename from lib/templates/csharp/while.hbs rename to lib/templates/languages/java/version-7/while.hbs diff --git a/lib/templates/python/_body.hbs b/lib/templates/languages/python/version-2.7/_body.hbs similarity index 100% rename from lib/templates/python/_body.hbs rename to lib/templates/languages/python/version-2.7/_body.hbs diff --git a/lib/templates/python/_item_as_def.hbs b/lib/templates/languages/python/version-2.7/_item_as_def.hbs similarity index 100% rename from lib/templates/python/_item_as_def.hbs rename to lib/templates/languages/python/version-2.7/_item_as_def.hbs diff --git a/lib/templates/python/_parameters.hbs b/lib/templates/languages/python/version-2.7/_parameters.hbs similarity index 100% rename from lib/templates/python/_parameters.hbs rename to lib/templates/languages/python/version-2.7/_parameters.hbs diff --git a/lib/templates/python/actionword.hbs b/lib/templates/languages/python/version-2.7/actionword.hbs similarity index 100% rename from lib/templates/python/actionword.hbs rename to lib/templates/languages/python/version-2.7/actionword.hbs diff --git a/lib/templates/python/actionwords.hbs b/lib/templates/languages/python/version-2.7/actionwords.hbs similarity index 100% rename from lib/templates/python/actionwords.hbs rename to lib/templates/languages/python/version-2.7/actionwords.hbs diff --git a/lib/templates/python/argument.hbs b/lib/templates/languages/python/version-2.7/argument.hbs similarity index 100% rename from lib/templates/python/argument.hbs rename to lib/templates/languages/python/version-2.7/argument.hbs diff --git a/lib/templates/groovy/assign.hbs b/lib/templates/languages/python/version-2.7/assign.hbs similarity index 100% rename from lib/templates/groovy/assign.hbs rename to lib/templates/languages/python/version-2.7/assign.hbs diff --git a/lib/templates/java/binaryexpression.hbs b/lib/templates/languages/python/version-2.7/binaryexpression.hbs similarity index 100% rename from lib/templates/java/binaryexpression.hbs rename to lib/templates/languages/python/version-2.7/binaryexpression.hbs diff --git a/lib/templates/python/booleanliteral.hbs b/lib/templates/languages/python/version-2.7/booleanliteral.hbs similarity index 100% rename from lib/templates/python/booleanliteral.hbs rename to lib/templates/languages/python/version-2.7/booleanliteral.hbs diff --git a/lib/templates/python/call.hbs b/lib/templates/languages/python/version-2.7/call.hbs similarity index 100% rename from lib/templates/python/call.hbs rename to lib/templates/languages/python/version-2.7/call.hbs diff --git a/lib/templates/javascript/dict.hbs b/lib/templates/languages/python/version-2.7/dict.hbs similarity index 100% rename from lib/templates/javascript/dict.hbs rename to lib/templates/languages/python/version-2.7/dict.hbs diff --git a/lib/templates/java/field.hbs b/lib/templates/languages/python/version-2.7/field.hbs similarity index 100% rename from lib/templates/java/field.hbs rename to lib/templates/languages/python/version-2.7/field.hbs diff --git a/lib/templates/python/ifthen.hbs b/lib/templates/languages/python/version-2.7/ifthen.hbs similarity index 100% rename from lib/templates/python/ifthen.hbs rename to lib/templates/languages/python/version-2.7/ifthen.hbs diff --git a/lib/templates/csharp/index.hbs b/lib/templates/languages/python/version-2.7/index.hbs similarity index 100% rename from lib/templates/csharp/index.hbs rename to lib/templates/languages/python/version-2.7/index.hbs diff --git a/lib/templates/python/libraries.hbs b/lib/templates/languages/python/version-2.7/libraries.hbs similarity index 100% rename from lib/templates/python/libraries.hbs rename to lib/templates/languages/python/version-2.7/libraries.hbs diff --git a/lib/templates/python/library.hbs b/lib/templates/languages/python/version-2.7/library.hbs similarity index 100% rename from lib/templates/python/library.hbs rename to lib/templates/languages/python/version-2.7/library.hbs diff --git a/lib/templates/python/libraryactionword.hbs b/lib/templates/languages/python/version-2.7/libraryactionword.hbs similarity index 100% rename from lib/templates/python/libraryactionword.hbs rename to lib/templates/languages/python/version-2.7/libraryactionword.hbs diff --git a/lib/templates/groovy/list.hbs b/lib/templates/languages/python/version-2.7/list.hbs similarity index 100% rename from lib/templates/groovy/list.hbs rename to lib/templates/languages/python/version-2.7/list.hbs diff --git a/lib/templates/python/nullliteral.hbs b/lib/templates/languages/python/version-2.7/nullliteral.hbs similarity index 100% rename from lib/templates/python/nullliteral.hbs rename to lib/templates/languages/python/version-2.7/nullliteral.hbs diff --git a/lib/templates/python/parameter.hbs b/lib/templates/languages/python/version-2.7/parameter.hbs similarity index 100% rename from lib/templates/python/parameter.hbs rename to lib/templates/languages/python/version-2.7/parameter.hbs diff --git a/lib/templates/java/parenthesis.hbs b/lib/templates/languages/python/version-2.7/parenthesis.hbs similarity index 100% rename from lib/templates/java/parenthesis.hbs rename to lib/templates/languages/python/version-2.7/parenthesis.hbs diff --git a/lib/templates/javascript/project.hbs b/lib/templates/languages/python/version-2.7/project.hbs similarity index 100% rename from lib/templates/javascript/project.hbs rename to lib/templates/languages/python/version-2.7/project.hbs diff --git a/lib/templates/python/property.hbs b/lib/templates/languages/python/version-2.7/property.hbs similarity index 100% rename from lib/templates/python/property.hbs rename to lib/templates/languages/python/version-2.7/property.hbs diff --git a/lib/templates/python/step.hbs b/lib/templates/languages/python/version-2.7/step.hbs similarity index 100% rename from lib/templates/python/step.hbs rename to lib/templates/languages/python/version-2.7/step.hbs diff --git a/lib/templates/javascript/tag.hbs b/lib/templates/languages/python/version-2.7/tag.hbs similarity index 100% rename from lib/templates/javascript/tag.hbs rename to lib/templates/languages/python/version-2.7/tag.hbs diff --git a/lib/templates/python/template.hbs b/lib/templates/languages/python/version-2.7/template.hbs similarity index 100% rename from lib/templates/python/template.hbs rename to lib/templates/languages/python/version-2.7/template.hbs diff --git a/lib/templates/python/while.hbs b/lib/templates/languages/python/version-2.7/while.hbs similarity index 100% rename from lib/templates/python/while.hbs rename to lib/templates/languages/python/version-2.7/while.hbs diff --git a/lib/templates/ruby/_body.hbs b/lib/templates/languages/ruby/version-2.3/_body.hbs similarity index 100% rename from lib/templates/ruby/_body.hbs rename to lib/templates/languages/ruby/version-2.3/_body.hbs diff --git a/lib/templates/ruby/minitest/_item_as_def.hbs b/lib/templates/languages/ruby/version-2.3/_item_as_def.hbs similarity index 100% rename from lib/templates/ruby/minitest/_item_as_def.hbs rename to lib/templates/languages/ruby/version-2.3/_item_as_def.hbs diff --git a/lib/templates/ruby/actionword.hbs b/lib/templates/languages/ruby/version-2.3/actionword.hbs similarity index 100% rename from lib/templates/ruby/actionword.hbs rename to lib/templates/languages/ruby/version-2.3/actionword.hbs diff --git a/lib/templates/ruby/actionwords.hbs b/lib/templates/languages/ruby/version-2.3/actionwords.hbs similarity index 100% rename from lib/templates/ruby/actionwords.hbs rename to lib/templates/languages/ruby/version-2.3/actionwords.hbs diff --git a/lib/templates/java/argument.hbs b/lib/templates/languages/ruby/version-2.3/argument.hbs similarity index 100% rename from lib/templates/java/argument.hbs rename to lib/templates/languages/ruby/version-2.3/argument.hbs diff --git a/lib/templates/python/assign.hbs b/lib/templates/languages/ruby/version-2.3/assign.hbs similarity index 100% rename from lib/templates/python/assign.hbs rename to lib/templates/languages/ruby/version-2.3/assign.hbs diff --git a/lib/templates/javascript/binaryexpression.hbs b/lib/templates/languages/ruby/version-2.3/binaryexpression.hbs similarity index 100% rename from lib/templates/javascript/binaryexpression.hbs rename to lib/templates/languages/ruby/version-2.3/binaryexpression.hbs diff --git a/lib/templates/ruby/call.hbs b/lib/templates/languages/ruby/version-2.3/call.hbs similarity index 100% rename from lib/templates/ruby/call.hbs rename to lib/templates/languages/ruby/version-2.3/call.hbs diff --git a/lib/templates/php/dict.hbs b/lib/templates/languages/ruby/version-2.3/dict.hbs similarity index 100% rename from lib/templates/php/dict.hbs rename to lib/templates/languages/ruby/version-2.3/dict.hbs diff --git a/lib/templates/javascript/field.hbs b/lib/templates/languages/ruby/version-2.3/field.hbs similarity index 100% rename from lib/templates/javascript/field.hbs rename to lib/templates/languages/ruby/version-2.3/field.hbs diff --git a/lib/templates/ruby/ifthen.hbs b/lib/templates/languages/ruby/version-2.3/ifthen.hbs similarity index 100% rename from lib/templates/ruby/ifthen.hbs rename to lib/templates/languages/ruby/version-2.3/ifthen.hbs diff --git a/lib/templates/groovy/index.hbs b/lib/templates/languages/ruby/version-2.3/index.hbs similarity index 100% rename from lib/templates/groovy/index.hbs rename to lib/templates/languages/ruby/version-2.3/index.hbs diff --git a/lib/templates/javascript/list.hbs b/lib/templates/languages/ruby/version-2.3/list.hbs similarity index 100% rename from lib/templates/javascript/list.hbs rename to lib/templates/languages/ruby/version-2.3/list.hbs diff --git a/lib/templates/ruby/parameter.hbs b/lib/templates/languages/ruby/version-2.3/parameter.hbs similarity index 100% rename from lib/templates/ruby/parameter.hbs rename to lib/templates/languages/ruby/version-2.3/parameter.hbs diff --git a/lib/templates/javascript/parenthesis.hbs b/lib/templates/languages/ruby/version-2.3/parenthesis.hbs similarity index 100% rename from lib/templates/javascript/parenthesis.hbs rename to lib/templates/languages/ruby/version-2.3/parenthesis.hbs diff --git a/lib/templates/php/project.hbs b/lib/templates/languages/ruby/version-2.3/project.hbs similarity index 100% rename from lib/templates/php/project.hbs rename to lib/templates/languages/ruby/version-2.3/project.hbs diff --git a/lib/templates/java/property.hbs b/lib/templates/languages/ruby/version-2.3/property.hbs similarity index 100% rename from lib/templates/java/property.hbs rename to lib/templates/languages/ruby/version-2.3/property.hbs diff --git a/lib/templates/ruby/step.hbs b/lib/templates/languages/ruby/version-2.3/step.hbs similarity index 100% rename from lib/templates/ruby/step.hbs rename to lib/templates/languages/ruby/version-2.3/step.hbs diff --git a/lib/templates/ruby/symbol.hbs b/lib/templates/languages/ruby/version-2.3/symbol.hbs similarity index 100% rename from lib/templates/ruby/symbol.hbs rename to lib/templates/languages/ruby/version-2.3/symbol.hbs diff --git a/lib/templates/php/tag.hbs b/lib/templates/languages/ruby/version-2.3/tag.hbs similarity index 100% rename from lib/templates/php/tag.hbs rename to lib/templates/languages/ruby/version-2.3/tag.hbs diff --git a/lib/templates/ruby/template.hbs b/lib/templates/languages/ruby/version-2.3/template.hbs similarity index 100% rename from lib/templates/ruby/template.hbs rename to lib/templates/languages/ruby/version-2.3/template.hbs diff --git a/lib/templates/ruby/while.hbs b/lib/templates/languages/ruby/version-2.3/while.hbs similarity index 100% rename from lib/templates/ruby/while.hbs rename to lib/templates/languages/ruby/version-2.3/while.hbs diff --git a/lib/templates/behat/actionword.hbs b/lib/templates_old/behat/actionword.hbs similarity index 100% rename from lib/templates/behat/actionword.hbs rename to lib/templates_old/behat/actionword.hbs diff --git a/lib/templates/behat/actionwords.hbs b/lib/templates_old/behat/actionwords.hbs similarity index 100% rename from lib/templates/behat/actionwords.hbs rename to lib/templates_old/behat/actionwords.hbs diff --git a/lib/templates/behat/actionwords/parameter.hbs b/lib/templates_old/behat/actionwords/parameter.hbs similarity index 100% rename from lib/templates/behat/actionwords/parameter.hbs rename to lib/templates_old/behat/actionwords/parameter.hbs diff --git a/lib/templates/behat/library.hbs b/lib/templates_old/behat/library.hbs similarity index 100% rename from lib/templates/behat/library.hbs rename to lib/templates_old/behat/library.hbs diff --git a/lib/templates/behat/libraryactionword.hbs b/lib/templates_old/behat/libraryactionword.hbs similarity index 100% rename from lib/templates/behat/libraryactionword.hbs rename to lib/templates_old/behat/libraryactionword.hbs diff --git a/lib/templates/behat/parameter.hbs b/lib/templates_old/behat/parameter.hbs similarity index 100% rename from lib/templates/behat/parameter.hbs rename to lib/templates_old/behat/parameter.hbs diff --git a/lib/templates/behave/actionword.hbs b/lib/templates_old/behave/actionword.hbs similarity index 100% rename from lib/templates/behave/actionword.hbs rename to lib/templates_old/behave/actionword.hbs diff --git a/lib/templates/behave/actionwords.hbs b/lib/templates_old/behave/actionwords.hbs similarity index 100% rename from lib/templates/behave/actionwords.hbs rename to lib/templates_old/behave/actionwords.hbs diff --git a/lib/templates/behave/library.hbs b/lib/templates_old/behave/library.hbs similarity index 100% rename from lib/templates/behave/library.hbs rename to lib/templates_old/behave/library.hbs diff --git a/lib/templates/behave/libraryactionword.hbs b/lib/templates_old/behave/libraryactionword.hbs similarity index 100% rename from lib/templates/behave/libraryactionword.hbs rename to lib/templates_old/behave/libraryactionword.hbs diff --git a/lib/templates/behave/nullliteral.hbs b/lib/templates_old/behave/nullliteral.hbs similarity index 100% rename from lib/templates/behave/nullliteral.hbs rename to lib/templates_old/behave/nullliteral.hbs diff --git a/lib/templates_old/common/_gherkin_pattern.hbs b/lib/templates_old/common/_gherkin_pattern.hbs new file mode 100644 index 00000000..cd5ebd23 --- /dev/null +++ b/lib/templates_old/common/_gherkin_pattern.hbs @@ -0,0 +1 @@ +^{{#strip}}{{#join chunks context.parameter_delimiter}}{{this.value}}{{/join}}{{#each extra_inlined_parameters}} {{context.parameter_delimiter}}{{this.value}}{{context.parameter_delimiter}}{{/each}}{{/strip}}$ \ No newline at end of file diff --git a/lib/templates_old/common/booleanliteral.hbs b/lib/templates_old/common/booleanliteral.hbs new file mode 100644 index 00000000..e8155a25 --- /dev/null +++ b/lib/templates_old/common/booleanliteral.hbs @@ -0,0 +1 @@ +{{to_string rendered_children.value }} \ No newline at end of file diff --git a/lib/templates/seleniumide/step.hbs b/lib/templates_old/common/dataset.hbs similarity index 100% rename from lib/templates/seleniumide/step.hbs rename to lib/templates_old/common/dataset.hbs diff --git a/lib/templates_old/common/datatable.hbs b/lib/templates_old/common/datatable.hbs new file mode 100644 index 00000000..898f94e0 --- /dev/null +++ b/lib/templates_old/common/datatable.hbs @@ -0,0 +1,3 @@ +{{#each rendered_children.datasets}} +{{{this}}} +{{/each}} \ No newline at end of file diff --git a/lib/templates_old/common/empty.hbs b/lib/templates_old/common/empty.hbs new file mode 100644 index 00000000..e69de29b diff --git a/lib/templates_old/common/nullliteral.hbs b/lib/templates_old/common/nullliteral.hbs new file mode 100644 index 00000000..90b5a842 --- /dev/null +++ b/lib/templates_old/common/nullliteral.hbs @@ -0,0 +1 @@ +nil \ No newline at end of file diff --git a/lib/templates/robotframework/stringliteral.hbs b/lib/templates_old/common/numericliteral.hbs similarity index 100% rename from lib/templates/robotframework/stringliteral.hbs rename to lib/templates_old/common/numericliteral.hbs diff --git a/lib/templates_old/common/stringliteral.hbs b/lib/templates_old/common/stringliteral.hbs new file mode 100644 index 00000000..647f098f --- /dev/null +++ b/lib/templates_old/common/stringliteral.hbs @@ -0,0 +1 @@ +'{{ rendered_children.value }}' \ No newline at end of file diff --git a/lib/templates_old/common/symbol.hbs b/lib/templates_old/common/symbol.hbs new file mode 100644 index 00000000..e8155a25 --- /dev/null +++ b/lib/templates_old/common/symbol.hbs @@ -0,0 +1 @@ +{{to_string rendered_children.value }} \ No newline at end of file diff --git a/lib/templates_old/common/unaryexpression.hbs b/lib/templates_old/common/unaryexpression.hbs new file mode 100644 index 00000000..3af50a91 --- /dev/null +++ b/lib/templates_old/common/unaryexpression.hbs @@ -0,0 +1 @@ +{{{ rendered_children.operator }}}{{{ rendered_children.expression }}} \ No newline at end of file diff --git a/lib/templates_old/common/variable.hbs b/lib/templates_old/common/variable.hbs new file mode 100644 index 00000000..3b3a88de --- /dev/null +++ b/lib/templates_old/common/variable.hbs @@ -0,0 +1 @@ +{{ underscore rendered_children.name }} \ No newline at end of file diff --git a/lib/templates/csharp/_body.hbs b/lib/templates_old/csharp/_body.hbs similarity index 100% rename from lib/templates/csharp/_body.hbs rename to lib/templates_old/csharp/_body.hbs diff --git a/lib/templates/csharp/_item_as_function.hbs b/lib/templates_old/csharp/_item_as_function.hbs similarity index 100% rename from lib/templates/csharp/_item_as_function.hbs rename to lib/templates_old/csharp/_item_as_function.hbs diff --git a/lib/templates/csharp/_scenario.hbs b/lib/templates_old/csharp/_scenario.hbs similarity index 100% rename from lib/templates/csharp/_scenario.hbs rename to lib/templates_old/csharp/_scenario.hbs diff --git a/lib/templates/java/actionword.hbs b/lib/templates_old/csharp/actionword.hbs similarity index 100% rename from lib/templates/java/actionword.hbs rename to lib/templates_old/csharp/actionword.hbs diff --git a/lib/templates/csharp/actionwords.hbs b/lib/templates_old/csharp/actionwords.hbs similarity index 100% rename from lib/templates/csharp/actionwords.hbs rename to lib/templates_old/csharp/actionwords.hbs diff --git a/lib/templates/javascript/argument.hbs b/lib/templates_old/csharp/argument.hbs similarity index 100% rename from lib/templates/javascript/argument.hbs rename to lib/templates_old/csharp/argument.hbs diff --git a/lib/templates/java/assign.hbs b/lib/templates_old/csharp/assign.hbs similarity index 100% rename from lib/templates/java/assign.hbs rename to lib/templates_old/csharp/assign.hbs diff --git a/lib/templates/php/binaryexpression.hbs b/lib/templates_old/csharp/binaryexpression.hbs similarity index 100% rename from lib/templates/php/binaryexpression.hbs rename to lib/templates_old/csharp/binaryexpression.hbs diff --git a/lib/templates/csharp/call.hbs b/lib/templates_old/csharp/call.hbs similarity index 100% rename from lib/templates/csharp/call.hbs rename to lib/templates_old/csharp/call.hbs diff --git a/lib/templates/csharp/dataset.hbs b/lib/templates_old/csharp/dataset.hbs similarity index 100% rename from lib/templates/csharp/dataset.hbs rename to lib/templates_old/csharp/dataset.hbs diff --git a/lib/templates/csharp/dict.hbs b/lib/templates_old/csharp/dict.hbs similarity index 100% rename from lib/templates/csharp/dict.hbs rename to lib/templates_old/csharp/dict.hbs diff --git a/lib/templates/python/field.hbs b/lib/templates_old/csharp/field.hbs similarity index 100% rename from lib/templates/python/field.hbs rename to lib/templates_old/csharp/field.hbs diff --git a/lib/templates/csharp/folder.hbs b/lib/templates_old/csharp/folder.hbs similarity index 100% rename from lib/templates/csharp/folder.hbs rename to lib/templates_old/csharp/folder.hbs diff --git a/lib/templates/java/ifthen.hbs b/lib/templates_old/csharp/ifthen.hbs similarity index 100% rename from lib/templates/java/ifthen.hbs rename to lib/templates_old/csharp/ifthen.hbs diff --git a/lib/templates/javascript/index.hbs b/lib/templates_old/csharp/index.hbs similarity index 100% rename from lib/templates/javascript/index.hbs rename to lib/templates_old/csharp/index.hbs diff --git a/lib/templates/csharp/list.hbs b/lib/templates_old/csharp/list.hbs similarity index 100% rename from lib/templates/csharp/list.hbs rename to lib/templates_old/csharp/list.hbs diff --git a/lib/templates/groovy/nullliteral.hbs b/lib/templates_old/csharp/nullliteral.hbs similarity index 100% rename from lib/templates/groovy/nullliteral.hbs rename to lib/templates_old/csharp/nullliteral.hbs diff --git a/lib/templates/csharp/parameter.hbs b/lib/templates_old/csharp/parameter.hbs similarity index 100% rename from lib/templates/csharp/parameter.hbs rename to lib/templates_old/csharp/parameter.hbs diff --git a/lib/templates/php/parenthesis.hbs b/lib/templates_old/csharp/parenthesis.hbs similarity index 100% rename from lib/templates/php/parenthesis.hbs rename to lib/templates_old/csharp/parenthesis.hbs diff --git a/lib/templates/csharp/property.hbs b/lib/templates_old/csharp/property.hbs similarity index 100% rename from lib/templates/csharp/property.hbs rename to lib/templates_old/csharp/property.hbs diff --git a/lib/templates/javascript/scenario.hbs b/lib/templates_old/csharp/scenario.hbs similarity index 100% rename from lib/templates/javascript/scenario.hbs rename to lib/templates_old/csharp/scenario.hbs diff --git a/lib/templates/csharp/scenarios.hbs b/lib/templates_old/csharp/scenarios.hbs similarity index 100% rename from lib/templates/csharp/scenarios.hbs rename to lib/templates_old/csharp/scenarios.hbs diff --git a/lib/templates/csharp/single_scenario.hbs b/lib/templates_old/csharp/single_scenario.hbs similarity index 100% rename from lib/templates/csharp/single_scenario.hbs rename to lib/templates_old/csharp/single_scenario.hbs diff --git a/lib/templates/csharp/single_test.hbs b/lib/templates_old/csharp/single_test.hbs similarity index 100% rename from lib/templates/csharp/single_test.hbs rename to lib/templates_old/csharp/single_test.hbs diff --git a/lib/templates/java/step.hbs b/lib/templates_old/csharp/step.hbs similarity index 100% rename from lib/templates/java/step.hbs rename to lib/templates_old/csharp/step.hbs diff --git a/lib/templates/java/stringliteral.hbs b/lib/templates_old/csharp/stringliteral.hbs similarity index 100% rename from lib/templates/java/stringliteral.hbs rename to lib/templates_old/csharp/stringliteral.hbs diff --git a/lib/templates/java/tag.hbs b/lib/templates_old/csharp/tag.hbs similarity index 100% rename from lib/templates/java/tag.hbs rename to lib/templates_old/csharp/tag.hbs diff --git a/lib/templates/csharp/template.hbs b/lib/templates_old/csharp/template.hbs similarity index 100% rename from lib/templates/csharp/template.hbs rename to lib/templates_old/csharp/template.hbs diff --git a/lib/templates/php/test.hbs b/lib/templates_old/csharp/test.hbs similarity index 100% rename from lib/templates/php/test.hbs rename to lib/templates_old/csharp/test.hbs diff --git a/lib/templates/csharp/tests.hbs b/lib/templates_old/csharp/tests.hbs similarity index 100% rename from lib/templates/csharp/tests.hbs rename to lib/templates_old/csharp/tests.hbs diff --git a/lib/templates/java/variable.hbs b/lib/templates_old/csharp/variable.hbs similarity index 100% rename from lib/templates/java/variable.hbs rename to lib/templates_old/csharp/variable.hbs diff --git a/lib/templates/java/while.hbs b/lib/templates_old/csharp/while.hbs similarity index 100% rename from lib/templates/java/while.hbs rename to lib/templates_old/csharp/while.hbs diff --git a/lib/templates_old/cucumber/actionword.hbs b/lib/templates_old/cucumber/actionword.hbs new file mode 100644 index 00000000..5cdd1eb8 --- /dev/null +++ b/lib/templates_old/cucumber/actionword.hbs @@ -0,0 +1,5 @@ +{{#if rendered_children.gherkin_annotation }} +{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/ do{{#if has_parameters?}} |{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}|{{/if}} +{{#indent}}{{ underscore rendered_children.name }}{{#if has_parameters?}}({{{ join rendered_children.parameters ', '}}}){{/if}}{{/indent}} +end +{{/if}} \ No newline at end of file diff --git a/lib/templates_old/cucumber/actionwords.hbs b/lib/templates_old/cucumber/actionwords.hbs new file mode 100644 index 00000000..5abd0c0a --- /dev/null +++ b/lib/templates_old/cucumber/actionwords.hbs @@ -0,0 +1,5 @@ +# encoding: UTF-8 + +require_relative 'actionwords' +World(Actionwords) +{{#each rendered_children.actionwords}}{{{this}}}{{/each}} \ No newline at end of file diff --git a/lib/templates/cucumber/groovy/step-definitions/_gherkin_pattern.hbs b/lib/templates_old/cucumber/groovy/step-definitions/_gherkin_pattern.hbs similarity index 100% rename from lib/templates/cucumber/groovy/step-definitions/_gherkin_pattern.hbs rename to lib/templates_old/cucumber/groovy/step-definitions/_gherkin_pattern.hbs diff --git a/lib/templates/cucumber/groovy/step-definitions/actionword.hbs b/lib/templates_old/cucumber/groovy/step-definitions/actionword.hbs similarity index 100% rename from lib/templates/cucumber/groovy/step-definitions/actionword.hbs rename to lib/templates_old/cucumber/groovy/step-definitions/actionword.hbs diff --git a/lib/templates/cucumber/groovy/step-definitions/actionwords.hbs b/lib/templates_old/cucumber/groovy/step-definitions/actionwords.hbs similarity index 100% rename from lib/templates/cucumber/groovy/step-definitions/actionwords.hbs rename to lib/templates_old/cucumber/groovy/step-definitions/actionwords.hbs diff --git a/lib/templates/cucumber/groovy/step-definitions/library.hbs b/lib/templates_old/cucumber/groovy/step-definitions/library.hbs similarity index 100% rename from lib/templates/cucumber/groovy/step-definitions/library.hbs rename to lib/templates_old/cucumber/groovy/step-definitions/library.hbs diff --git a/lib/templates/cucumber/groovy/step-definitions/libraryactionword.hbs b/lib/templates_old/cucumber/groovy/step-definitions/libraryactionword.hbs similarity index 100% rename from lib/templates/cucumber/groovy/step-definitions/libraryactionword.hbs rename to lib/templates_old/cucumber/groovy/step-definitions/libraryactionword.hbs diff --git a/lib/templates/cucumber/java/parameter.hbs b/lib/templates_old/cucumber/groovy/step-definitions/parameter.hbs similarity index 100% rename from lib/templates/cucumber/java/parameter.hbs rename to lib/templates_old/cucumber/groovy/step-definitions/parameter.hbs diff --git a/lib/templates/jbehave/steps/actionword.hbs b/lib/templates_old/cucumber/java/actionword.hbs similarity index 100% rename from lib/templates/jbehave/steps/actionword.hbs rename to lib/templates_old/cucumber/java/actionword.hbs diff --git a/lib/templates_old/cucumber/java/actionwords.hbs b/lib/templates_old/cucumber/java/actionwords.hbs new file mode 100644 index 00000000..cb896520 --- /dev/null +++ b/lib/templates_old/cucumber/java/actionwords.hbs @@ -0,0 +1,12 @@ +package {{{ context.package }}}; + +import cucumber.api.DataTable; +import cucumber.api.java.en.*; + +public class StepDefinitions {{#curly}}{{#indent}} +public Actionwords {{{ context.call_prefix }}} = new Actionwords(); + +{{#each rendered_children.actionwords}}{{{this}}} +{{/each}} +{{/indent}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates_old/cucumber/java/actionwords/parameter.hbs b/lib/templates_old/cucumber/java/actionwords/parameter.hbs new file mode 100644 index 00000000..14b81e2f --- /dev/null +++ b/lib/templates_old/cucumber/java/actionwords/parameter.hbs @@ -0,0 +1 @@ +{{#if is_datatable?}}DataTable{{else}}{{#if is_bool?}}boolean{{else}}{{{ node.type }}}{{/if}}{{/if}} {{{ camelize_lower rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates_old/cucumber/java/parameter.hbs b/lib/templates_old/cucumber/java/parameter.hbs new file mode 100644 index 00000000..14b81e2f --- /dev/null +++ b/lib/templates_old/cucumber/java/parameter.hbs @@ -0,0 +1 @@ +{{#if is_datatable?}}DataTable{{else}}{{#if is_bool?}}boolean{{else}}{{{ node.type }}}{{/if}}{{/if}} {{{ camelize_lower rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates/cucumber/javascript/_after_hook.hbs b/lib/templates_old/cucumber/javascript/_after_hook.hbs similarity index 100% rename from lib/templates/cucumber/javascript/_after_hook.hbs rename to lib/templates_old/cucumber/javascript/_after_hook.hbs diff --git a/lib/templates/cucumber/javascript/_before_hook.hbs b/lib/templates_old/cucumber/javascript/_before_hook.hbs similarity index 100% rename from lib/templates/cucumber/javascript/_before_hook.hbs rename to lib/templates_old/cucumber/javascript/_before_hook.hbs diff --git a/lib/templates/cucumber/javascript/actionword.hbs b/lib/templates_old/cucumber/javascript/actionword.hbs similarity index 100% rename from lib/templates/cucumber/javascript/actionword.hbs rename to lib/templates_old/cucumber/javascript/actionword.hbs diff --git a/lib/templates/cucumber/javascript/actionwords.hbs b/lib/templates_old/cucumber/javascript/actionwords.hbs similarity index 100% rename from lib/templates/cucumber/javascript/actionwords.hbs rename to lib/templates_old/cucumber/javascript/actionwords.hbs diff --git a/lib/templates/javascript/parameter.hbs b/lib/templates_old/cucumber/parameter.hbs similarity index 100% rename from lib/templates/javascript/parameter.hbs rename to lib/templates_old/cucumber/parameter.hbs diff --git a/lib/templates/cucumber/typescript/_after_hook.hbs b/lib/templates_old/cucumber/typescript/_after_hook.hbs similarity index 100% rename from lib/templates/cucumber/typescript/_after_hook.hbs rename to lib/templates_old/cucumber/typescript/_after_hook.hbs diff --git a/lib/templates/cucumber/typescript/_before_hook.hbs b/lib/templates_old/cucumber/typescript/_before_hook.hbs similarity index 100% rename from lib/templates/cucumber/typescript/_before_hook.hbs rename to lib/templates_old/cucumber/typescript/_before_hook.hbs diff --git a/lib/templates/cucumber/typescript/actionword.hbs b/lib/templates_old/cucumber/typescript/actionword.hbs similarity index 100% rename from lib/templates/cucumber/typescript/actionword.hbs rename to lib/templates_old/cucumber/typescript/actionword.hbs diff --git a/lib/templates/cucumber/typescript/actionwords.hbs b/lib/templates_old/cucumber/typescript/actionwords.hbs similarity index 100% rename from lib/templates/cucumber/typescript/actionwords.hbs rename to lib/templates_old/cucumber/typescript/actionwords.hbs diff --git a/lib/templates/cucumber/typescript/library.hbs b/lib/templates_old/cucumber/typescript/library.hbs similarity index 100% rename from lib/templates/cucumber/typescript/library.hbs rename to lib/templates_old/cucumber/typescript/library.hbs diff --git a/lib/templates/cucumber/typescript/libraryactionword.hbs b/lib/templates_old/cucumber/typescript/libraryactionword.hbs similarity index 100% rename from lib/templates/cucumber/typescript/libraryactionword.hbs rename to lib/templates_old/cucumber/typescript/libraryactionword.hbs diff --git a/lib/templates_old/gherkin/_call.hbs b/lib/templates_old/gherkin/_call.hbs new file mode 100644 index 00000000..bf1540e4 --- /dev/null +++ b/lib/templates_old/gherkin/_call.hbs @@ -0,0 +1,5 @@ +{{> gherkin_text}}{{#if rendered_children.free_text_arg}}{{#indent}} +""" +{{remove_surrounding_quotes rendered_children.free_text_arg }} +"""{{/indent}}{{/if}}{{#if rendered_children.datatable_arg}}{{#indent}} +{{remove_surrounding_quotes rendered_children.datatable_arg }}{{/indent}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/_gherkin_text.hbs b/lib/templates_old/gherkin/_gherkin_text.hbs new file mode 100644 index 00000000..3029fd5b --- /dev/null +++ b/lib/templates_old/gherkin/_gherkin_text.hbs @@ -0,0 +1 @@ +{{#if rendered_children.annotation}}{{{capitalize rendered_children.annotation }}}{{else}}*{{/if}} {{#strip}}{{#join chunks context.parameter_delimiter}}{{this.value}}{{/join}}{{#each extra_inlined_arguments}} {{context.parameter_delimiter}}{{this.value}}{{context.parameter_delimiter}}{{/each}}{{/strip}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/_scenario.hbs b/lib/templates_old/gherkin/_scenario.hbs new file mode 100644 index 00000000..188ddf80 --- /dev/null +++ b/lib/templates_old/gherkin/_scenario.hbs @@ -0,0 +1,18 @@ +{{#if has_datasets?}} +{{#if has_tags?}}{{join rendered_children.tags ' '}} +{{/if}}{{> scenario_outline_title}}{{#indent}} +{{#if has_description?}}{{description_with_annotations rendered_children.description}} +{{/if}}{{#each rendered_children.body}}{{{ this }}} +{{/each}} +Examples:{{#indent}} +{{#if context.with_dataset_names}}| dataset name {{/if}}| {{ join rendered_children.parameters ' | ' }} |{{#if context.uids}} hiptest-uid |{{/if}} +{{{rendered_children.datatable}}} +{{/indent}}{{/indent}} +{{else}} +{{#if has_tags?}}{{join rendered_children.tags ' '}} +{{/if}}Scenario: {{{ rendered_children.name }}}{{#if context.uids}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{/if}}{{#indent}} +{{#if has_description?}}{{description_with_annotations rendered_children.description}} +{{/if}}{{#each rendered_children.body}}{{{ this }}} +{{/each}} +{{/indent}} +{{/if}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/_scenario_outline_title.hbs b/lib/templates_old/gherkin/_scenario_outline_title.hbs new file mode 100644 index 00000000..772f5b66 --- /dev/null +++ b/lib/templates_old/gherkin/_scenario_outline_title.hbs @@ -0,0 +1 @@ +Scenario Outline: {{{ rendered_children.name }}}{{#if context.uids}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/argument.hbs b/lib/templates_old/gherkin/argument.hbs new file mode 100644 index 00000000..65f2c1bb --- /dev/null +++ b/lib/templates_old/gherkin/argument.hbs @@ -0,0 +1 @@ +{{ rendered_children.value }} \ No newline at end of file diff --git a/lib/templates_old/gherkin/call.hbs b/lib/templates_old/gherkin/call.hbs new file mode 100644 index 00000000..e649ca7c --- /dev/null +++ b/lib/templates_old/gherkin/call.hbs @@ -0,0 +1 @@ +{{> call}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/dataset.hbs b/lib/templates_old/gherkin/dataset.hbs new file mode 100644 index 00000000..51dda924 --- /dev/null +++ b/lib/templates_old/gherkin/dataset.hbs @@ -0,0 +1 @@ +{{#if context.with_dataset_names}}| {{rendered_children.name}} {{/if}}| {{{ join_gherkin_dataset rendered_children.arguments }}} |{{#if context.uids}} {{#if rendered_children.test_snapshot_uid}}uid:{{{rendered_children.test_snapshot_uid}}}{{/if}} |{{/if}} \ No newline at end of file diff --git a/lib/templates/groovy/datatable.hbs b/lib/templates_old/gherkin/datatable.hbs similarity index 100% rename from lib/templates/groovy/datatable.hbs rename to lib/templates_old/gherkin/datatable.hbs diff --git a/lib/templates_old/gherkin/folder.hbs b/lib/templates_old/gherkin/folder.hbs new file mode 100644 index 00000000..06a2cd27 --- /dev/null +++ b/lib/templates_old/gherkin/folder.hbs @@ -0,0 +1,10 @@ +{{#if rendered_children.ancestor_tags}}{{#if context.parent_folder_tags}}{{#each rendered_children.ancestor_tags}}{{this}} {{/each}}{{#unless has_tags?}} +{{/unless}}{{/if}}{{/if}}{{#if has_tags?}}{{join rendered_children.tags ' '}} +{{/if}}Feature: {{{ rendered_children.name }}}{{#indent}} +{{#if rendered_children.description}}{{#indent}}{{description_with_annotations rendered_children.description}}{{/indent}}{{/if}} +{{#unless is_empty?}} +Background:{{#indent}} +{{#each rendered_children.body}}{{{ this }}} +{{/each}}{{/indent}} +{{/unless}}{{#each rendered_children.scenarios}}{{{this}}}{{/each}} +{{/indent}} diff --git a/lib/templates_old/gherkin/inlined_uids/_scenario_outline_title.hbs b/lib/templates_old/gherkin/inlined_uids/_scenario_outline_title.hbs new file mode 100644 index 00000000..8a578e6f --- /dev/null +++ b/lib/templates_old/gherkin/inlined_uids/_scenario_outline_title.hbs @@ -0,0 +1 @@ +Scenario Outline: {{{ rendered_children.name }}}{{#if context.uids}} (){{/if}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/java/single_scenario.hbs b/lib/templates_old/gherkin/java/single_scenario.hbs new file mode 100644 index 00000000..5b04aa24 --- /dev/null +++ b/lib/templates_old/gherkin/java/single_scenario.hbs @@ -0,0 +1 @@ +{{#unless is_empty?}}{{> scenario}}{{/unless}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/parameter.hbs b/lib/templates_old/gherkin/parameter.hbs new file mode 100644 index 00000000..696d8a3a --- /dev/null +++ b/lib/templates_old/gherkin/parameter.hbs @@ -0,0 +1 @@ +{{{ rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/scenarios.hbs b/lib/templates_old/gherkin/scenarios.hbs new file mode 100644 index 00000000..085e6b63 --- /dev/null +++ b/lib/templates_old/gherkin/scenarios.hbs @@ -0,0 +1,3 @@ +# To export your project to Gherkin correctly, you can add the option +# --with-folders when calling hiptest-publisher. It will keep the +# HipTest folders hierarchy of your project. \ No newline at end of file diff --git a/lib/templates/php/scenario.hbs b/lib/templates_old/gherkin/single_scenario.hbs similarity index 100% rename from lib/templates/php/scenario.hbs rename to lib/templates_old/gherkin/single_scenario.hbs diff --git a/lib/templates_old/gherkin/single_test.hbs b/lib/templates_old/gherkin/single_test.hbs new file mode 100644 index 00000000..1bcfb212 --- /dev/null +++ b/lib/templates_old/gherkin/single_test.hbs @@ -0,0 +1,3 @@ +Scenario: {{{ rendered_children.name }}}{{#indent}} +{{#each rendered_children.body}}{{{ this }}} +{{/each}}{{/indent}} diff --git a/lib/templates_old/gherkin/step.hbs b/lib/templates_old/gherkin/step.hbs new file mode 100644 index 00000000..036a24f7 --- /dev/null +++ b/lib/templates_old/gherkin/step.hbs @@ -0,0 +1 @@ +{{#comment '#'}}{{{rendered_children.key}}}: {{{rendered_children.value}}}{{/comment}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/stringliteral.hbs b/lib/templates_old/gherkin/stringliteral.hbs new file mode 100644 index 00000000..fc7bc351 --- /dev/null +++ b/lib/templates_old/gherkin/stringliteral.hbs @@ -0,0 +1 @@ +{{#unescape_single_quotes}}{{ rendered_children.value }}{{/unescape_single_quotes}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/tag.hbs b/lib/templates_old/gherkin/tag.hbs new file mode 100644 index 00000000..f0694ec6 --- /dev/null +++ b/lib/templates_old/gherkin/tag.hbs @@ -0,0 +1 @@ +@{{{ rendered_children.key }}}{{#if has_value? }}-{{{normalize_with_dashes rendered_children.value }}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/gherkin/template.hbs b/lib/templates_old/gherkin/template.hbs new file mode 100644 index 00000000..4772c77b --- /dev/null +++ b/lib/templates_old/gherkin/template.hbs @@ -0,0 +1 @@ +{{#each treated_chunks}}{{#if this.is_variable?}}<{{{this.raw.children.name}}}>{{else}}{{{ this.raw.children.value }}}{{/if}}{{/each}} \ No newline at end of file diff --git a/lib/templates/groovy/_body.hbs b/lib/templates_old/groovy/_body.hbs similarity index 100% rename from lib/templates/groovy/_body.hbs rename to lib/templates_old/groovy/_body.hbs diff --git a/lib/templates/groovy/_desc.hbs b/lib/templates_old/groovy/_desc.hbs similarity index 100% rename from lib/templates/groovy/_desc.hbs rename to lib/templates_old/groovy/_desc.hbs diff --git a/lib/templates/groovy/_scenario.hbs b/lib/templates_old/groovy/_scenario.hbs similarity index 100% rename from lib/templates/groovy/_scenario.hbs rename to lib/templates_old/groovy/_scenario.hbs diff --git a/lib/templates/groovy/_steps.hbs b/lib/templates_old/groovy/_steps.hbs similarity index 100% rename from lib/templates/groovy/_steps.hbs rename to lib/templates_old/groovy/_steps.hbs diff --git a/lib/templates/groovy/_test.hbs b/lib/templates_old/groovy/_test.hbs similarity index 100% rename from lib/templates/groovy/_test.hbs rename to lib/templates_old/groovy/_test.hbs diff --git a/lib/templates/groovy/actionword.hbs b/lib/templates_old/groovy/actionword.hbs similarity index 100% rename from lib/templates/groovy/actionword.hbs rename to lib/templates_old/groovy/actionword.hbs diff --git a/lib/templates/groovy/actionwords.hbs b/lib/templates_old/groovy/actionwords.hbs similarity index 100% rename from lib/templates/groovy/actionwords.hbs rename to lib/templates_old/groovy/actionwords.hbs diff --git a/lib/templates/ruby/assign.hbs b/lib/templates_old/groovy/assign.hbs similarity index 100% rename from lib/templates/ruby/assign.hbs rename to lib/templates_old/groovy/assign.hbs diff --git a/lib/templates/groovy/call.hbs b/lib/templates_old/groovy/call.hbs similarity index 100% rename from lib/templates/groovy/call.hbs rename to lib/templates_old/groovy/call.hbs diff --git a/lib/templates/groovy/dataset.hbs b/lib/templates_old/groovy/dataset.hbs similarity index 100% rename from lib/templates/groovy/dataset.hbs rename to lib/templates_old/groovy/dataset.hbs diff --git a/lib/templates/robotframework/datatable.hbs b/lib/templates_old/groovy/datatable.hbs similarity index 100% rename from lib/templates/robotframework/datatable.hbs rename to lib/templates_old/groovy/datatable.hbs diff --git a/lib/templates/groovy/dict.hbs b/lib/templates_old/groovy/dict.hbs similarity index 100% rename from lib/templates/groovy/dict.hbs rename to lib/templates_old/groovy/dict.hbs diff --git a/lib/templates/groovy/folder.hbs b/lib/templates_old/groovy/folder.hbs similarity index 100% rename from lib/templates/groovy/folder.hbs rename to lib/templates_old/groovy/folder.hbs diff --git a/lib/templates/php/index.hbs b/lib/templates_old/groovy/index.hbs similarity index 100% rename from lib/templates/php/index.hbs rename to lib/templates_old/groovy/index.hbs diff --git a/lib/templates/groovy/libraries.hbs b/lib/templates_old/groovy/libraries.hbs similarity index 100% rename from lib/templates/groovy/libraries.hbs rename to lib/templates_old/groovy/libraries.hbs diff --git a/lib/templates/groovy/library.hbs b/lib/templates_old/groovy/library.hbs similarity index 100% rename from lib/templates/groovy/library.hbs rename to lib/templates_old/groovy/library.hbs diff --git a/lib/templates/groovy/libraryactionword.hbs b/lib/templates_old/groovy/libraryactionword.hbs similarity index 100% rename from lib/templates/groovy/libraryactionword.hbs rename to lib/templates_old/groovy/libraryactionword.hbs diff --git a/lib/templates/php/list.hbs b/lib/templates_old/groovy/list.hbs similarity index 100% rename from lib/templates/php/list.hbs rename to lib/templates_old/groovy/list.hbs diff --git a/lib/templates/java/nullliteral.hbs b/lib/templates_old/groovy/nullliteral.hbs similarity index 100% rename from lib/templates/java/nullliteral.hbs rename to lib/templates_old/groovy/nullliteral.hbs diff --git a/lib/templates/groovy/parameter.hbs b/lib/templates_old/groovy/parameter.hbs similarity index 100% rename from lib/templates/groovy/parameter.hbs rename to lib/templates_old/groovy/parameter.hbs diff --git a/lib/templates/javascript/property.hbs b/lib/templates_old/groovy/property.hbs similarity index 100% rename from lib/templates/javascript/property.hbs rename to lib/templates_old/groovy/property.hbs diff --git a/lib/templates/python/scenario.hbs b/lib/templates_old/groovy/scenario.hbs similarity index 100% rename from lib/templates/python/scenario.hbs rename to lib/templates_old/groovy/scenario.hbs diff --git a/lib/templates/groovy/scenarios.hbs b/lib/templates_old/groovy/scenarios.hbs similarity index 100% rename from lib/templates/groovy/scenarios.hbs rename to lib/templates_old/groovy/scenarios.hbs diff --git a/lib/templates/groovy/single_scenario.hbs b/lib/templates_old/groovy/single_scenario.hbs similarity index 100% rename from lib/templates/groovy/single_scenario.hbs rename to lib/templates_old/groovy/single_scenario.hbs diff --git a/lib/templates/groovy/single_test.hbs b/lib/templates_old/groovy/single_test.hbs similarity index 100% rename from lib/templates/groovy/single_test.hbs rename to lib/templates_old/groovy/single_test.hbs diff --git a/lib/templates/groovy/template.hbs b/lib/templates_old/groovy/template.hbs similarity index 100% rename from lib/templates/groovy/template.hbs rename to lib/templates_old/groovy/template.hbs diff --git a/lib/templates/groovy/test.hbs b/lib/templates_old/groovy/test.hbs similarity index 100% rename from lib/templates/groovy/test.hbs rename to lib/templates_old/groovy/test.hbs diff --git a/lib/templates/groovy/tests.hbs b/lib/templates_old/groovy/tests.hbs similarity index 100% rename from lib/templates/groovy/tests.hbs rename to lib/templates_old/groovy/tests.hbs diff --git a/lib/templates_old/java/_body.hbs b/lib/templates_old/java/_body.hbs new file mode 100644 index 00000000..1976f53b --- /dev/null +++ b/lib/templates_old/java/_body.hbs @@ -0,0 +1,5 @@ +{{#indent}} +{{#each rendered_children.body}}{{{this}}} +{{/each}} +{{#if has_step?}}throw new UnsupportedOperationException();{{/if}} +{{/indent}} \ No newline at end of file diff --git a/lib/templates_old/java/_item_as_function.hbs b/lib/templates_old/java/_item_as_function.hbs new file mode 100644 index 00000000..1d9044ee --- /dev/null +++ b/lib/templates_old/java/_item_as_function.hbs @@ -0,0 +1,8 @@ +public void {{{ camelize_lower uniq_name }}}({{#if has_parameters?}}{{{join rendered_children.parameters ', '}}}{{/if}}) {{#curly}} +{{#clear_empty_lines}} +{{#indent}}{{#comment '//'}}{{#if has_tags?}}Tags: {{{ join rendered_children.tags ' '}}} +{{/if}}{{#if has_description?}}{{rendered_children.description}} +{{/if}}{{/comment}}{{/indent}} +{{> body}} +{{/clear_empty_lines}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates/java/_scenario.hbs b/lib/templates_old/java/_scenario.hbs similarity index 100% rename from lib/templates/java/_scenario.hbs rename to lib/templates_old/java/_scenario.hbs diff --git a/lib/templates/typescript/actionword.hbs b/lib/templates_old/java/actionword.hbs old mode 100755 new mode 100644 similarity index 100% rename from lib/templates/typescript/actionword.hbs rename to lib/templates_old/java/actionword.hbs diff --git a/lib/templates_old/java/actionwords.hbs b/lib/templates_old/java/actionwords.hbs new file mode 100644 index 00000000..24f9c092 --- /dev/null +++ b/lib/templates_old/java/actionwords.hbs @@ -0,0 +1,8 @@ +package {{{ context.package }}}; + +public class Actionwords {{#if uses_library?}}extends ActionwordLibrary {{/if}}{{#curly}}{{#indent}} +{{#each rendered_children.actionwords}} +{{{this}}} +{{/each}} +{{/indent}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates/php/argument.hbs b/lib/templates_old/java/argument.hbs similarity index 100% rename from lib/templates/php/argument.hbs rename to lib/templates_old/java/argument.hbs diff --git a/lib/templates/javascript/assign.hbs b/lib/templates_old/java/assign.hbs similarity index 100% rename from lib/templates/javascript/assign.hbs rename to lib/templates_old/java/assign.hbs diff --git a/lib/templates/python/binaryexpression.hbs b/lib/templates_old/java/binaryexpression.hbs similarity index 100% rename from lib/templates/python/binaryexpression.hbs rename to lib/templates_old/java/binaryexpression.hbs diff --git a/lib/templates_old/java/call.hbs b/lib/templates_old/java/call.hbs new file mode 100644 index 00000000..4c79f545 --- /dev/null +++ b/lib/templates_old/java/call.hbs @@ -0,0 +1,2 @@ +{{#if has_annotation? }}{{#comment '//'}}{{{ rendered_children.gherkin_text }}}{{/comment}} +{{/if}}{{#if context.call_prefix}}{{{context.call_prefix}}}.{{/if}}{{#if is_shared?}}get{{camelize rendered_children.library_name}}Library().{{/if}}{{{ camelize_lower rendered_children.actionword }}}({{{ join rendered_children.all_arguments ', '}}}); \ No newline at end of file diff --git a/lib/templates_old/java/dataset.hbs b/lib/templates_old/java/dataset.hbs new file mode 100644 index 00000000..178cea80 --- /dev/null +++ b/lib/templates_old/java/dataset.hbs @@ -0,0 +1,3 @@ +public void test{{{ camelize scenario_name}}}{{{ camelize rendered_children.name}}}{{#if rendered_children.test_snapshot_uid}}Uid{{{ normalize rendered_children.test_snapshot_uid}}}{{/if}}() {{#curly}} +{{#indent}}{{{ camelize_lower scenario_name }}}({{{ join rendered_children.arguments ', '}}});{{/indent}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates/python/dict.hbs b/lib/templates_old/java/dict.hbs similarity index 100% rename from lib/templates/python/dict.hbs rename to lib/templates_old/java/dict.hbs diff --git a/lib/templates/java/espresso/_scenario.hbs b/lib/templates_old/java/espresso/_scenario.hbs similarity index 100% rename from lib/templates/java/espresso/_scenario.hbs rename to lib/templates_old/java/espresso/_scenario.hbs diff --git a/lib/templates/java/espresso/dataset.hbs b/lib/templates_old/java/espresso/dataset.hbs similarity index 100% rename from lib/templates/java/espresso/dataset.hbs rename to lib/templates_old/java/espresso/dataset.hbs diff --git a/lib/templates/java/espresso/folder.hbs b/lib/templates_old/java/espresso/folder.hbs similarity index 100% rename from lib/templates/java/espresso/folder.hbs rename to lib/templates_old/java/espresso/folder.hbs diff --git a/lib/templates/java/espresso/scenarios.hbs b/lib/templates_old/java/espresso/scenarios.hbs similarity index 100% rename from lib/templates/java/espresso/scenarios.hbs rename to lib/templates_old/java/espresso/scenarios.hbs diff --git a/lib/templates/java/espresso/single_scenario.hbs b/lib/templates_old/java/espresso/single_scenario.hbs similarity index 100% rename from lib/templates/java/espresso/single_scenario.hbs rename to lib/templates_old/java/espresso/single_scenario.hbs diff --git a/lib/templates/java/espresso/single_test.hbs b/lib/templates_old/java/espresso/single_test.hbs similarity index 100% rename from lib/templates/java/espresso/single_test.hbs rename to lib/templates_old/java/espresso/single_test.hbs diff --git a/lib/templates/java/espresso/tests.hbs b/lib/templates_old/java/espresso/tests.hbs similarity index 100% rename from lib/templates/java/espresso/tests.hbs rename to lib/templates_old/java/espresso/tests.hbs diff --git a/lib/templates/ruby/field.hbs b/lib/templates_old/java/field.hbs similarity index 100% rename from lib/templates/ruby/field.hbs rename to lib/templates_old/java/field.hbs diff --git a/lib/templates/java/folder.hbs b/lib/templates_old/java/folder.hbs similarity index 100% rename from lib/templates/java/folder.hbs rename to lib/templates_old/java/folder.hbs diff --git a/lib/templates_old/java/ifthen.hbs b/lib/templates_old/java/ifthen.hbs new file mode 100644 index 00000000..5c703c52 --- /dev/null +++ b/lib/templates_old/java/ifthen.hbs @@ -0,0 +1,7 @@ +if ({{{ rendered_children.condition }}}) {{#curly}} +{{#indent}}{{#each rendered_children.then}}{{{this}}} +{{/each}}{{/indent}} +{{#if has_else?}}} else { +{{#indent}}{{#each rendered_children.else}}{{{this}}} +{{/each}}{{/indent}} +{{/if}}{{/curly}} \ No newline at end of file diff --git a/lib/templates_old/java/index.hbs b/lib/templates_old/java/index.hbs new file mode 100644 index 00000000..d929a8d5 --- /dev/null +++ b/lib/templates_old/java/index.hbs @@ -0,0 +1 @@ +{{{ rendered_children.base }}}.get({{{ rendered_children.expression }}}) \ No newline at end of file diff --git a/lib/templates_old/java/libraries.hbs b/lib/templates_old/java/libraries.hbs new file mode 100644 index 00000000..5ac35b6e --- /dev/null +++ b/lib/templates_old/java/libraries.hbs @@ -0,0 +1,9 @@ +package {{{ context.package }}}; + +public class ActionwordLibrary {{#curly}}{{#indent}}{{#each library_names}} +public {{camelize this}}Library get{{camelize this}}Library() {{#curly}}{{#indent}} +return new {{camelize this}}Library(); +{{/indent}} +{{/curly}} +{{/each}}{{/indent}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates_old/java/library.hbs b/lib/templates_old/java/library.hbs new file mode 100644 index 00000000..72dec1b0 --- /dev/null +++ b/lib/templates_old/java/library.hbs @@ -0,0 +1,7 @@ +package {{{ context.package }}}; + +public class {{camelize rendered_children.name}}Library extends ActionwordLibrary {{#curly}}{{#indent}}{{#each rendered_children.library_actionwords}} +{{{this}}} +{{/each}} +{{/indent}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates_old/java/libraryactionword.hbs b/lib/templates_old/java/libraryactionword.hbs new file mode 100644 index 00000000..d7d4d5dd --- /dev/null +++ b/lib/templates_old/java/libraryactionword.hbs @@ -0,0 +1 @@ +{{> item_as_function}} \ No newline at end of file diff --git a/lib/templates_old/java/list.hbs b/lib/templates_old/java/list.hbs new file mode 100644 index 00000000..12f0f61f --- /dev/null +++ b/lib/templates_old/java/list.hbs @@ -0,0 +1 @@ +new String[]{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}} \ No newline at end of file diff --git a/lib/templates/javascript/nullliteral.hbs b/lib/templates_old/java/nullliteral.hbs similarity index 100% rename from lib/templates/javascript/nullliteral.hbs rename to lib/templates_old/java/nullliteral.hbs diff --git a/lib/templates_old/java/parameter.hbs b/lib/templates_old/java/parameter.hbs new file mode 100644 index 00000000..e54232fe --- /dev/null +++ b/lib/templates_old/java/parameter.hbs @@ -0,0 +1 @@ +{{#if is_bool?}}boolean{{else}}{{{ node.type }}}{{/if}} {{{ camelize_lower rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates/python/parenthesis.hbs b/lib/templates_old/java/parenthesis.hbs similarity index 100% rename from lib/templates/python/parenthesis.hbs rename to lib/templates_old/java/parenthesis.hbs diff --git a/lib/templates/robotframework/property.hbs b/lib/templates_old/java/property.hbs similarity index 100% rename from lib/templates/robotframework/property.hbs rename to lib/templates_old/java/property.hbs diff --git a/lib/templates/ruby/minitest/scenario.hbs b/lib/templates_old/java/scenario.hbs similarity index 100% rename from lib/templates/ruby/minitest/scenario.hbs rename to lib/templates_old/java/scenario.hbs diff --git a/lib/templates/java/scenarios.hbs b/lib/templates_old/java/scenarios.hbs similarity index 100% rename from lib/templates/java/scenarios.hbs rename to lib/templates_old/java/scenarios.hbs diff --git a/lib/templates/java/single_scenario.hbs b/lib/templates_old/java/single_scenario.hbs similarity index 100% rename from lib/templates/java/single_scenario.hbs rename to lib/templates_old/java/single_scenario.hbs diff --git a/lib/templates/java/single_test.hbs b/lib/templates_old/java/single_test.hbs similarity index 100% rename from lib/templates/java/single_test.hbs rename to lib/templates_old/java/single_test.hbs diff --git a/lib/templates_old/java/step.hbs b/lib/templates_old/java/step.hbs new file mode 100644 index 00000000..12e09970 --- /dev/null +++ b/lib/templates_old/java/step.hbs @@ -0,0 +1 @@ +{{#comment '//'}}TODO: Implement {{{ rendered_children.key }}}: {{{ rendered_children.value }}}{{/comment}} \ No newline at end of file diff --git a/lib/templates_old/java/stringliteral.hbs b/lib/templates_old/java/stringliteral.hbs new file mode 100644 index 00000000..7b6fdb6a --- /dev/null +++ b/lib/templates_old/java/stringliteral.hbs @@ -0,0 +1 @@ +"{{ rendered_children.value }}" \ No newline at end of file diff --git a/lib/templates_old/java/tag.hbs b/lib/templates_old/java/tag.hbs new file mode 100644 index 00000000..ca20f6a6 --- /dev/null +++ b/lib/templates_old/java/tag.hbs @@ -0,0 +1 @@ +{{{ rendered_children.key }}}{{#if has_value? }}:{{{ rendered_children.value }}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/java/template.hbs b/lib/templates_old/java/template.hbs new file mode 100644 index 00000000..20709a26 --- /dev/null +++ b/lib/templates_old/java/template.hbs @@ -0,0 +1 @@ +{{#if variable_names}}String.format({{/if}}"{{#each treated_chunks}}{{#if this.is_variable?}}%s{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"{{#if variable_names}}, {{{join variable_names ', '}}}){{/if}} \ No newline at end of file diff --git a/lib/templates/python/test.hbs b/lib/templates_old/java/test.hbs similarity index 100% rename from lib/templates/python/test.hbs rename to lib/templates_old/java/test.hbs diff --git a/lib/templates/java/testng/_scenario.hbs b/lib/templates_old/java/testng/_scenario.hbs similarity index 100% rename from lib/templates/java/testng/_scenario.hbs rename to lib/templates_old/java/testng/_scenario.hbs diff --git a/lib/templates/java/testng/dataset.hbs b/lib/templates_old/java/testng/dataset.hbs similarity index 100% rename from lib/templates/java/testng/dataset.hbs rename to lib/templates_old/java/testng/dataset.hbs diff --git a/lib/templates/java/testng/folder.hbs b/lib/templates_old/java/testng/folder.hbs similarity index 100% rename from lib/templates/java/testng/folder.hbs rename to lib/templates_old/java/testng/folder.hbs diff --git a/lib/templates/java/testng/scenarios.hbs b/lib/templates_old/java/testng/scenarios.hbs similarity index 100% rename from lib/templates/java/testng/scenarios.hbs rename to lib/templates_old/java/testng/scenarios.hbs diff --git a/lib/templates/java/testng/single_scenario.hbs b/lib/templates_old/java/testng/single_scenario.hbs similarity index 100% rename from lib/templates/java/testng/single_scenario.hbs rename to lib/templates_old/java/testng/single_scenario.hbs diff --git a/lib/templates/java/testng/single_test.hbs b/lib/templates_old/java/testng/single_test.hbs similarity index 100% rename from lib/templates/java/testng/single_test.hbs rename to lib/templates_old/java/testng/single_test.hbs diff --git a/lib/templates/java/testng/tests.hbs b/lib/templates_old/java/testng/tests.hbs similarity index 100% rename from lib/templates/java/testng/tests.hbs rename to lib/templates_old/java/testng/tests.hbs diff --git a/lib/templates/java/tests.hbs b/lib/templates_old/java/tests.hbs similarity index 100% rename from lib/templates/java/tests.hbs rename to lib/templates_old/java/tests.hbs diff --git a/lib/templates_old/java/variable.hbs b/lib/templates_old/java/variable.hbs new file mode 100644 index 00000000..dcb05d48 --- /dev/null +++ b/lib/templates_old/java/variable.hbs @@ -0,0 +1 @@ +{{ camelize_lower rendered_children.name }} \ No newline at end of file diff --git a/lib/templates_old/java/while.hbs b/lib/templates_old/java/while.hbs new file mode 100644 index 00000000..a42d50f9 --- /dev/null +++ b/lib/templates_old/java/while.hbs @@ -0,0 +1,4 @@ +while ({{{ rendered_children.condition }}}) {{#curly}}{{#indent}} +{{#each rendered_children.body}}{{{this}}} +{{/each}}{{/indent}} +{{/curly}} \ No newline at end of file diff --git a/lib/templates/javascript/_body.hbs b/lib/templates_old/javascript/_body.hbs similarity index 100% rename from lib/templates/javascript/_body.hbs rename to lib/templates_old/javascript/_body.hbs diff --git a/lib/templates/javascript/_item_as_function.hbs b/lib/templates_old/javascript/_item_as_function.hbs similarity index 100% rename from lib/templates/javascript/_item_as_function.hbs rename to lib/templates_old/javascript/_item_as_function.hbs diff --git a/lib/templates/javascript/_item_as_hash_key.hbs b/lib/templates_old/javascript/_item_as_hash_key.hbs similarity index 100% rename from lib/templates/javascript/_item_as_hash_key.hbs rename to lib/templates_old/javascript/_item_as_hash_key.hbs diff --git a/lib/templates/javascript/_module_declaration.hbs b/lib/templates_old/javascript/_module_declaration.hbs similarity index 100% rename from lib/templates/javascript/_module_declaration.hbs rename to lib/templates_old/javascript/_module_declaration.hbs diff --git a/lib/templates/javascript/_scenario.hbs b/lib/templates_old/javascript/_scenario.hbs similarity index 100% rename from lib/templates/javascript/_scenario.hbs rename to lib/templates_old/javascript/_scenario.hbs diff --git a/lib/templates/javascript/actionword.hbs b/lib/templates_old/javascript/actionword.hbs similarity index 100% rename from lib/templates/javascript/actionword.hbs rename to lib/templates_old/javascript/actionword.hbs diff --git a/lib/templates/javascript/actionwords.hbs b/lib/templates_old/javascript/actionwords.hbs similarity index 100% rename from lib/templates/javascript/actionwords.hbs rename to lib/templates_old/javascript/actionwords.hbs diff --git a/lib/templates/robotframework/argument.hbs b/lib/templates_old/javascript/argument.hbs similarity index 100% rename from lib/templates/robotframework/argument.hbs rename to lib/templates_old/javascript/argument.hbs diff --git a/lib/templates/php/assign.hbs b/lib/templates_old/javascript/assign.hbs similarity index 100% rename from lib/templates/php/assign.hbs rename to lib/templates_old/javascript/assign.hbs diff --git a/lib/templates/ruby/binaryexpression.hbs b/lib/templates_old/javascript/binaryexpression.hbs similarity index 100% rename from lib/templates/ruby/binaryexpression.hbs rename to lib/templates_old/javascript/binaryexpression.hbs diff --git a/lib/templates/javascript/call.hbs b/lib/templates_old/javascript/call.hbs similarity index 100% rename from lib/templates/javascript/call.hbs rename to lib/templates_old/javascript/call.hbs diff --git a/lib/templates/javascript/codeceptjs/actionword.hbs b/lib/templates_old/javascript/codeceptjs/actionword.hbs similarity index 100% rename from lib/templates/javascript/codeceptjs/actionword.hbs rename to lib/templates_old/javascript/codeceptjs/actionword.hbs diff --git a/lib/templates/javascript/codeceptjs/actionwords.hbs b/lib/templates_old/javascript/codeceptjs/actionwords.hbs similarity index 100% rename from lib/templates/javascript/codeceptjs/actionwords.hbs rename to lib/templates_old/javascript/codeceptjs/actionwords.hbs diff --git a/lib/templates/javascript/dataset.hbs b/lib/templates_old/javascript/dataset.hbs similarity index 100% rename from lib/templates/javascript/dataset.hbs rename to lib/templates_old/javascript/dataset.hbs diff --git a/lib/templates/ruby/dict.hbs b/lib/templates_old/javascript/dict.hbs similarity index 100% rename from lib/templates/ruby/dict.hbs rename to lib/templates_old/javascript/dict.hbs diff --git a/lib/templates/javascript/es6/actionwords.hbs b/lib/templates_old/javascript/es6/actionwords.hbs similarity index 100% rename from lib/templates/javascript/es6/actionwords.hbs rename to lib/templates_old/javascript/es6/actionwords.hbs diff --git a/lib/templates_old/javascript/field.hbs b/lib/templates_old/javascript/field.hbs new file mode 100644 index 00000000..23e02b80 --- /dev/null +++ b/lib/templates_old/javascript/field.hbs @@ -0,0 +1 @@ +{{{ rendered_children.base }}}.{{{ rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates/javascript/folder.hbs b/lib/templates_old/javascript/folder.hbs similarity index 100% rename from lib/templates/javascript/folder.hbs rename to lib/templates_old/javascript/folder.hbs diff --git a/lib/templates/javascript/ifthen.hbs b/lib/templates_old/javascript/ifthen.hbs similarity index 100% rename from lib/templates/javascript/ifthen.hbs rename to lib/templates_old/javascript/ifthen.hbs diff --git a/lib/templates/python/index.hbs b/lib/templates_old/javascript/index.hbs similarity index 100% rename from lib/templates/python/index.hbs rename to lib/templates_old/javascript/index.hbs diff --git a/lib/templates/javascript/jasmine/_before_each.hbs b/lib/templates_old/javascript/jasmine/_before_each.hbs similarity index 100% rename from lib/templates/javascript/jasmine/_before_each.hbs rename to lib/templates_old/javascript/jasmine/_before_each.hbs diff --git a/lib/templates/javascript/jasmine/_scenario.hbs b/lib/templates_old/javascript/jasmine/_scenario.hbs similarity index 100% rename from lib/templates/javascript/jasmine/_scenario.hbs rename to lib/templates_old/javascript/jasmine/_scenario.hbs diff --git a/lib/templates/javascript/jasmine/dataset.hbs b/lib/templates_old/javascript/jasmine/dataset.hbs similarity index 100% rename from lib/templates/javascript/jasmine/dataset.hbs rename to lib/templates_old/javascript/jasmine/dataset.hbs diff --git a/lib/templates/javascript/jasmine/folder.hbs b/lib/templates_old/javascript/jasmine/folder.hbs similarity index 100% rename from lib/templates/javascript/jasmine/folder.hbs rename to lib/templates_old/javascript/jasmine/folder.hbs diff --git a/lib/templates/javascript/jasmine/scenarios.hbs b/lib/templates_old/javascript/jasmine/scenarios.hbs similarity index 100% rename from lib/templates/javascript/jasmine/scenarios.hbs rename to lib/templates_old/javascript/jasmine/scenarios.hbs diff --git a/lib/templates/javascript/jasmine/single_scenario.hbs b/lib/templates_old/javascript/jasmine/single_scenario.hbs similarity index 100% rename from lib/templates/javascript/jasmine/single_scenario.hbs rename to lib/templates_old/javascript/jasmine/single_scenario.hbs diff --git a/lib/templates/javascript/jasmine/single_test.hbs b/lib/templates_old/javascript/jasmine/single_test.hbs similarity index 100% rename from lib/templates/javascript/jasmine/single_test.hbs rename to lib/templates_old/javascript/jasmine/single_test.hbs diff --git a/lib/templates/javascript/jasmine/tests.hbs b/lib/templates_old/javascript/jasmine/tests.hbs similarity index 100% rename from lib/templates/javascript/jasmine/tests.hbs rename to lib/templates_old/javascript/jasmine/tests.hbs diff --git a/lib/templates/python/list.hbs b/lib/templates_old/javascript/list.hbs similarity index 100% rename from lib/templates/python/list.hbs rename to lib/templates_old/javascript/list.hbs diff --git a/lib/templates/javascript/mocha/_before_each.hbs b/lib/templates_old/javascript/mocha/_before_each.hbs similarity index 100% rename from lib/templates/javascript/mocha/_before_each.hbs rename to lib/templates_old/javascript/mocha/_before_each.hbs diff --git a/lib/templates/javascript/mocha/folder.hbs b/lib/templates_old/javascript/mocha/folder.hbs similarity index 100% rename from lib/templates/javascript/mocha/folder.hbs rename to lib/templates_old/javascript/mocha/folder.hbs diff --git a/lib/templates_old/javascript/nullliteral.hbs b/lib/templates_old/javascript/nullliteral.hbs new file mode 100644 index 00000000..ec747fa4 --- /dev/null +++ b/lib/templates_old/javascript/nullliteral.hbs @@ -0,0 +1 @@ +null \ No newline at end of file diff --git a/lib/templates_old/javascript/parameter.hbs b/lib/templates_old/javascript/parameter.hbs new file mode 100644 index 00000000..9c702f4c --- /dev/null +++ b/lib/templates_old/javascript/parameter.hbs @@ -0,0 +1 @@ +{{{ underscore rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates/ruby/parenthesis.hbs b/lib/templates_old/javascript/parenthesis.hbs similarity index 100% rename from lib/templates/ruby/parenthesis.hbs rename to lib/templates_old/javascript/parenthesis.hbs diff --git a/lib/templates/python/project.hbs b/lib/templates_old/javascript/project.hbs similarity index 100% rename from lib/templates/python/project.hbs rename to lib/templates_old/javascript/project.hbs diff --git a/lib/templates/ruby/property.hbs b/lib/templates_old/javascript/property.hbs similarity index 100% rename from lib/templates/ruby/property.hbs rename to lib/templates_old/javascript/property.hbs diff --git a/lib/templates/ruby/scenario.hbs b/lib/templates_old/javascript/scenario.hbs similarity index 100% rename from lib/templates/ruby/scenario.hbs rename to lib/templates_old/javascript/scenario.hbs diff --git a/lib/templates/javascript/scenarios.hbs b/lib/templates_old/javascript/scenarios.hbs similarity index 100% rename from lib/templates/javascript/scenarios.hbs rename to lib/templates_old/javascript/scenarios.hbs diff --git a/lib/templates/javascript/single_scenario.hbs b/lib/templates_old/javascript/single_scenario.hbs similarity index 100% rename from lib/templates/javascript/single_scenario.hbs rename to lib/templates_old/javascript/single_scenario.hbs diff --git a/lib/templates/javascript/single_test.hbs b/lib/templates_old/javascript/single_test.hbs similarity index 100% rename from lib/templates/javascript/single_test.hbs rename to lib/templates_old/javascript/single_test.hbs diff --git a/lib/templates/javascript/step.hbs b/lib/templates_old/javascript/step.hbs similarity index 100% rename from lib/templates/javascript/step.hbs rename to lib/templates_old/javascript/step.hbs diff --git a/lib/templates/python/tag.hbs b/lib/templates_old/javascript/tag.hbs similarity index 100% rename from lib/templates/python/tag.hbs rename to lib/templates_old/javascript/tag.hbs diff --git a/lib/templates/javascript/template.hbs b/lib/templates_old/javascript/template.hbs similarity index 100% rename from lib/templates/javascript/template.hbs rename to lib/templates_old/javascript/template.hbs diff --git a/lib/templates/ruby/minitest/test.hbs b/lib/templates_old/javascript/test.hbs similarity index 100% rename from lib/templates/ruby/minitest/test.hbs rename to lib/templates_old/javascript/test.hbs diff --git a/lib/templates/javascript/tests.hbs b/lib/templates_old/javascript/tests.hbs similarity index 100% rename from lib/templates/javascript/tests.hbs rename to lib/templates_old/javascript/tests.hbs diff --git a/lib/templates/javascript/while.hbs b/lib/templates_old/javascript/while.hbs similarity index 100% rename from lib/templates/javascript/while.hbs rename to lib/templates_old/javascript/while.hbs diff --git a/lib/templates/jbehave/_scenario.hbs b/lib/templates_old/jbehave/_scenario.hbs similarity index 100% rename from lib/templates/jbehave/_scenario.hbs rename to lib/templates_old/jbehave/_scenario.hbs diff --git a/lib/templates/jbehave/actionwords/parameter.hbs b/lib/templates_old/jbehave/actionwords/parameter.hbs similarity index 100% rename from lib/templates/jbehave/actionwords/parameter.hbs rename to lib/templates_old/jbehave/actionwords/parameter.hbs diff --git a/lib/templates/jbehave/call.hbs b/lib/templates_old/jbehave/call.hbs similarity index 100% rename from lib/templates/jbehave/call.hbs rename to lib/templates_old/jbehave/call.hbs diff --git a/lib/templates/jbehave/folder.hbs b/lib/templates_old/jbehave/folder.hbs similarity index 100% rename from lib/templates/jbehave/folder.hbs rename to lib/templates_old/jbehave/folder.hbs diff --git a/lib/templates/jbehave/single_test.hbs b/lib/templates_old/jbehave/single_test.hbs similarity index 100% rename from lib/templates/jbehave/single_test.hbs rename to lib/templates_old/jbehave/single_test.hbs diff --git a/lib/templates/jbehave/steps/_gherkin_pattern.hbs b/lib/templates_old/jbehave/steps/_gherkin_pattern.hbs similarity index 100% rename from lib/templates/jbehave/steps/_gherkin_pattern.hbs rename to lib/templates_old/jbehave/steps/_gherkin_pattern.hbs diff --git a/lib/templates_old/jbehave/steps/actionword.hbs b/lib/templates_old/jbehave/steps/actionword.hbs new file mode 100644 index 00000000..b34c5537 --- /dev/null +++ b/lib/templates_old/jbehave/steps/actionword.hbs @@ -0,0 +1,6 @@ +{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{#escape_backslashes_and_double_quotes}}{{> gherkin_pattern}}{{/escape_backslashes_and_double_quotes}}") +public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters_ordered_by_pattern ', '}}}) {{#curly}}{{#indent}} +{{{ context.call_prefix }}}.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}}); +{{/indent}} +{{/curly}} +{{/if}} \ No newline at end of file diff --git a/lib/templates/jbehave/steps/actionwords.hbs b/lib/templates_old/jbehave/steps/actionwords.hbs similarity index 100% rename from lib/templates/jbehave/steps/actionwords.hbs rename to lib/templates_old/jbehave/steps/actionwords.hbs diff --git a/lib/templates/php/_body.hbs b/lib/templates_old/php/_body.hbs similarity index 100% rename from lib/templates/php/_body.hbs rename to lib/templates_old/php/_body.hbs diff --git a/lib/templates/php/_item_as_function.hbs b/lib/templates_old/php/_item_as_function.hbs similarity index 100% rename from lib/templates/php/_item_as_function.hbs rename to lib/templates_old/php/_item_as_function.hbs diff --git a/lib/templates/php/_scenario.hbs b/lib/templates_old/php/_scenario.hbs similarity index 100% rename from lib/templates/php/_scenario.hbs rename to lib/templates_old/php/_scenario.hbs diff --git a/lib/templates/php/_setup.hbs b/lib/templates_old/php/_setup.hbs similarity index 100% rename from lib/templates/php/_setup.hbs rename to lib/templates_old/php/_setup.hbs diff --git a/lib/templates/php/actionword.hbs b/lib/templates_old/php/actionword.hbs similarity index 100% rename from lib/templates/php/actionword.hbs rename to lib/templates_old/php/actionword.hbs diff --git a/lib/templates/php/actionwords.hbs b/lib/templates_old/php/actionwords.hbs similarity index 100% rename from lib/templates/php/actionwords.hbs rename to lib/templates_old/php/actionwords.hbs diff --git a/lib/templates/ruby/argument.hbs b/lib/templates_old/php/argument.hbs similarity index 100% rename from lib/templates/ruby/argument.hbs rename to lib/templates_old/php/argument.hbs diff --git a/lib/templates_old/php/assign.hbs b/lib/templates_old/php/assign.hbs new file mode 100644 index 00000000..c5d09a96 --- /dev/null +++ b/lib/templates_old/php/assign.hbs @@ -0,0 +1 @@ +{{{ rendered_children.to }}} = {{{ rendered_children.value }}}; \ No newline at end of file diff --git a/lib/templates_old/php/binaryexpression.hbs b/lib/templates_old/php/binaryexpression.hbs new file mode 100644 index 00000000..f0147c66 --- /dev/null +++ b/lib/templates_old/php/binaryexpression.hbs @@ -0,0 +1 @@ +{{{ rendered_children.left }}} {{{ rendered_children.operator }}} {{{ rendered_children.right }}} \ No newline at end of file diff --git a/lib/templates/php/call.hbs b/lib/templates_old/php/call.hbs similarity index 100% rename from lib/templates/php/call.hbs rename to lib/templates_old/php/call.hbs diff --git a/lib/templates/php/dataset.hbs b/lib/templates_old/php/dataset.hbs similarity index 100% rename from lib/templates/php/dataset.hbs rename to lib/templates_old/php/dataset.hbs diff --git a/lib/templates_old/php/dict.hbs b/lib/templates_old/php/dict.hbs new file mode 100644 index 00000000..d6824356 --- /dev/null +++ b/lib/templates_old/php/dict.hbs @@ -0,0 +1 @@ +{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}} \ No newline at end of file diff --git a/lib/templates/php/field.hbs b/lib/templates_old/php/field.hbs similarity index 100% rename from lib/templates/php/field.hbs rename to lib/templates_old/php/field.hbs diff --git a/lib/templates/php/folder.hbs b/lib/templates_old/php/folder.hbs similarity index 100% rename from lib/templates/php/folder.hbs rename to lib/templates_old/php/folder.hbs diff --git a/lib/templates/php/ifthen.hbs b/lib/templates_old/php/ifthen.hbs similarity index 100% rename from lib/templates/php/ifthen.hbs rename to lib/templates_old/php/ifthen.hbs diff --git a/lib/templates/ruby/index.hbs b/lib/templates_old/php/index.hbs similarity index 100% rename from lib/templates/ruby/index.hbs rename to lib/templates_old/php/index.hbs diff --git a/lib/templates/php/libraries.hbs b/lib/templates_old/php/libraries.hbs similarity index 100% rename from lib/templates/php/libraries.hbs rename to lib/templates_old/php/libraries.hbs diff --git a/lib/templates/php/library.hbs b/lib/templates_old/php/library.hbs similarity index 100% rename from lib/templates/php/library.hbs rename to lib/templates_old/php/library.hbs diff --git a/lib/templates/php/libraryactionword.hbs b/lib/templates_old/php/libraryactionword.hbs similarity index 100% rename from lib/templates/php/libraryactionword.hbs rename to lib/templates_old/php/libraryactionword.hbs diff --git a/lib/templates/ruby/list.hbs b/lib/templates_old/php/list.hbs similarity index 100% rename from lib/templates/ruby/list.hbs rename to lib/templates_old/php/list.hbs diff --git a/lib/templates/php/nullliteral.hbs b/lib/templates_old/php/nullliteral.hbs similarity index 100% rename from lib/templates/php/nullliteral.hbs rename to lib/templates_old/php/nullliteral.hbs diff --git a/lib/templates/php/parameter.hbs b/lib/templates_old/php/parameter.hbs similarity index 100% rename from lib/templates/php/parameter.hbs rename to lib/templates_old/php/parameter.hbs diff --git a/lib/templates_old/php/parenthesis.hbs b/lib/templates_old/php/parenthesis.hbs new file mode 100644 index 00000000..e99abc81 --- /dev/null +++ b/lib/templates_old/php/parenthesis.hbs @@ -0,0 +1 @@ +({{{ rendered_children.content }}}) \ No newline at end of file diff --git a/lib/templates/ruby/project.hbs b/lib/templates_old/php/project.hbs similarity index 100% rename from lib/templates/ruby/project.hbs rename to lib/templates_old/php/project.hbs diff --git a/lib/templates/php/property.hbs b/lib/templates_old/php/property.hbs similarity index 100% rename from lib/templates/php/property.hbs rename to lib/templates_old/php/property.hbs diff --git a/lib/templates/ruby/test.hbs b/lib/templates_old/php/scenario.hbs similarity index 100% rename from lib/templates/ruby/test.hbs rename to lib/templates_old/php/scenario.hbs diff --git a/lib/templates/php/scenarios.hbs b/lib/templates_old/php/scenarios.hbs similarity index 100% rename from lib/templates/php/scenarios.hbs rename to lib/templates_old/php/scenarios.hbs diff --git a/lib/templates/php/single_scenario.hbs b/lib/templates_old/php/single_scenario.hbs similarity index 100% rename from lib/templates/php/single_scenario.hbs rename to lib/templates_old/php/single_scenario.hbs diff --git a/lib/templates/php/single_test.hbs b/lib/templates_old/php/single_test.hbs similarity index 100% rename from lib/templates/php/single_test.hbs rename to lib/templates_old/php/single_test.hbs diff --git a/lib/templates/php/step.hbs b/lib/templates_old/php/step.hbs similarity index 100% rename from lib/templates/php/step.hbs rename to lib/templates_old/php/step.hbs diff --git a/lib/templates/ruby/tag.hbs b/lib/templates_old/php/tag.hbs similarity index 100% rename from lib/templates/ruby/tag.hbs rename to lib/templates_old/php/tag.hbs diff --git a/lib/templates/php/template.hbs b/lib/templates_old/php/template.hbs similarity index 100% rename from lib/templates/php/template.hbs rename to lib/templates_old/php/template.hbs diff --git a/lib/templates_old/php/test.hbs b/lib/templates_old/php/test.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/php/test.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates/php/tests.hbs b/lib/templates_old/php/tests.hbs similarity index 100% rename from lib/templates/php/tests.hbs rename to lib/templates_old/php/tests.hbs diff --git a/lib/templates/php/variable.hbs b/lib/templates_old/php/variable.hbs similarity index 100% rename from lib/templates/php/variable.hbs rename to lib/templates_old/php/variable.hbs diff --git a/lib/templates/php/while.hbs b/lib/templates_old/php/while.hbs similarity index 100% rename from lib/templates/php/while.hbs rename to lib/templates_old/php/while.hbs diff --git a/lib/templates_old/python/_body.hbs b/lib/templates_old/python/_body.hbs new file mode 100644 index 00000000..9d10e70d --- /dev/null +++ b/lib/templates_old/python/_body.hbs @@ -0,0 +1,11 @@ +{{#clear_empty_lines}} +{{#indent}} +{{#comment '#'}}{{#if has_description?}}{{{ rendered_children.description }}} +{{/if}}{{#if has_tags?}}Tags: {{{ join rendered_children.tags ' '}}} +{{/if}}{{/comment}} +{{#each rendered_children.body}}{{{this}}} +{{/each}} +{{#if has_step?}}raise NotImplementedError{{/if}} +{{#if is_empty?}}pass{{/if}} +{{/indent}} +{{/clear_empty_lines}} \ No newline at end of file diff --git a/lib/templates_old/python/_item_as_def.hbs b/lib/templates_old/python/_item_as_def.hbs new file mode 100644 index 00000000..354ad5f3 --- /dev/null +++ b/lib/templates_old/python/_item_as_def.hbs @@ -0,0 +1,2 @@ +def {{{ underscore rendered_children.name }}}({{> parameters}}): +{{> body}} \ No newline at end of file diff --git a/lib/templates_old/python/_parameters.hbs b/lib/templates_old/python/_parameters.hbs new file mode 100644 index 00000000..fefd7db3 --- /dev/null +++ b/lib/templates_old/python/_parameters.hbs @@ -0,0 +1 @@ +self{{#if has_parameters?}}, {{{join rendered_children.parameters ', '}}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/python/_scenario.hbs b/lib/templates_old/python/_scenario.hbs new file mode 100644 index 00000000..0695c850 --- /dev/null +++ b/lib/templates_old/python/_scenario.hbs @@ -0,0 +1,4 @@ +{{#if has_datasets?}}{{> item_as_def}} +{{{ rendered_children.datatable }}} +{{else}}def test_{{{ normalize_lower self_name }}}{{#if rendered_children.uid}}_uid{{{ normalize_lower rendered_children.uid}}}{{/if}}({{> parameters}}): +{{> body}}{{/if}} diff --git a/lib/templates_old/python/actionword.hbs b/lib/templates_old/python/actionword.hbs new file mode 100644 index 00000000..cd837e5d --- /dev/null +++ b/lib/templates_old/python/actionword.hbs @@ -0,0 +1 @@ +{{> item_as_def}} diff --git a/lib/templates_old/python/actionwords.hbs b/lib/templates_old/python/actionwords.hbs new file mode 100644 index 00000000..3a2a1534 --- /dev/null +++ b/lib/templates_old/python/actionwords.hbs @@ -0,0 +1,12 @@ +# encoding: UTF-8 + +{{#if uses_library?}}from steps.actionword_library import ActionwordLibrary{{/if}} + + +class Actionwords{{#if uses_library?}}(ActionwordLibrary){{/if}}:{{#indent}} +def __init__(self):{{#indent}} +pass{{/indent}} + +{{#each rendered_children.actionwords}}{{{this}}} +{{/each}} +{{/indent}} diff --git a/lib/templates_old/python/argument.hbs b/lib/templates_old/python/argument.hbs new file mode 100644 index 00000000..b9a88755 --- /dev/null +++ b/lib/templates_old/python/argument.hbs @@ -0,0 +1 @@ +{{#escape_new_line}}{{#trim_surrounding_characters "__"}}{{{ underscore rendered_children.name }}}{{/trim_surrounding_characters}} = {{{ rendered_children.value }}}{{/escape_new_line}} \ No newline at end of file diff --git a/lib/templates_old/python/assign.hbs b/lib/templates_old/python/assign.hbs new file mode 100644 index 00000000..7b7f3bbe --- /dev/null +++ b/lib/templates_old/python/assign.hbs @@ -0,0 +1 @@ +{{{ rendered_children.to }}} = {{{ rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates_old/python/binaryexpression.hbs b/lib/templates_old/python/binaryexpression.hbs new file mode 100644 index 00000000..f0147c66 --- /dev/null +++ b/lib/templates_old/python/binaryexpression.hbs @@ -0,0 +1 @@ +{{{ rendered_children.left }}} {{{ rendered_children.operator }}} {{{ rendered_children.right }}} \ No newline at end of file diff --git a/lib/templates_old/python/booleanliteral.hbs b/lib/templates_old/python/booleanliteral.hbs new file mode 100644 index 00000000..5b192146 --- /dev/null +++ b/lib/templates_old/python/booleanliteral.hbs @@ -0,0 +1 @@ +{{capitalize rendered_children.value }} \ No newline at end of file diff --git a/lib/templates_old/python/call.hbs b/lib/templates_old/python/call.hbs new file mode 100644 index 00000000..92018228 --- /dev/null +++ b/lib/templates_old/python/call.hbs @@ -0,0 +1,2 @@ +{{#if has_annotation? }}{{#comment '#'}}{{{ rendered_children.gherkin_text }}}{{/comment}} +{{/if}}self.{{#if context.call_prefix}}{{{ context.call_prefix }}}.{{/if}}{{#if is_shared?}}get{{{camelize rendered_children.library_name}}}Library().{{/if}}{{{ underscore rendered_children.actionword }}}({{{ join rendered_children.all_arguments ', '}}}) \ No newline at end of file diff --git a/lib/templates_old/python/dataset.hbs b/lib/templates_old/python/dataset.hbs new file mode 100644 index 00000000..59557ca3 --- /dev/null +++ b/lib/templates_old/python/dataset.hbs @@ -0,0 +1,2 @@ +def test_{{{ normalize scenario_name}}}_{{{ normalize_lower rendered_children.name}}}{{#if rendered_children.test_snapshot_uid}}_uid{{{ normalize rendered_children.test_snapshot_uid}}}{{/if}}(self): + self.{{{ underscore scenario_name }}}({{{ join rendered_children.arguments ', ' }}}) \ No newline at end of file diff --git a/lib/templates_old/python/dict.hbs b/lib/templates_old/python/dict.hbs new file mode 100644 index 00000000..d6824356 --- /dev/null +++ b/lib/templates_old/python/dict.hbs @@ -0,0 +1 @@ +{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}} \ No newline at end of file diff --git a/lib/templates_old/python/field.hbs b/lib/templates_old/python/field.hbs new file mode 100644 index 00000000..23e02b80 --- /dev/null +++ b/lib/templates_old/python/field.hbs @@ -0,0 +1 @@ +{{{ rendered_children.base }}}.{{{ rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates_old/python/folder.hbs b/lib/templates_old/python/folder.hbs new file mode 100644 index 00000000..b5371fde --- /dev/null +++ b/lib/templates_old/python/folder.hbs @@ -0,0 +1,12 @@ +# encoding: UTF-8 +import unittest +from actionwords import Actionwords + +class Test{{{ camelize self_name }}}(unittest.TestCase):{{#indent}} +def setUp(self):{{#indent}} +self.actionwords = Actionwords(self){{/indent}} +{{#unless is_empty?}}{{> body}} +{{/unless}} +{{#each rendered_children.scenarios}}{{{this}}} +{{/each}} +{{/indent}} diff --git a/lib/templates_old/python/ifthen.hbs b/lib/templates_old/python/ifthen.hbs new file mode 100644 index 00000000..280c3ff3 --- /dev/null +++ b/lib/templates_old/python/ifthen.hbs @@ -0,0 +1,4 @@ +if ({{{ rendered_children.condition }}}): +{{#indent}}{{{ join rendered_children.then '\n'}}}{{/indent}}{{#if has_else?}} +else: +{{#indent}}{{{ join rendered_children.else '\n'}}}{{/indent}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/python/index.hbs b/lib/templates_old/python/index.hbs new file mode 100644 index 00000000..8521d3fa --- /dev/null +++ b/lib/templates_old/python/index.hbs @@ -0,0 +1 @@ +{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}] \ No newline at end of file diff --git a/lib/templates_old/python/libraries.hbs b/lib/templates_old/python/libraries.hbs new file mode 100644 index 00000000..e98d4028 --- /dev/null +++ b/lib/templates_old/python/libraries.hbs @@ -0,0 +1,9 @@ +# encoding: UTF-8 + +{{#each library_names}}from steps.{{downcase this}}_library import {{camelize this}}Library +{{/each}} + +class ActionwordLibrary:{{#indent}}{{#each library_names}} +def get{{camelize this}}Library(self):{{#indent}} +return {{camelize this}}Library(self){{/indent}} +{{/each}}{{/indent}} diff --git a/lib/templates_old/python/library.hbs b/lib/templates_old/python/library.hbs new file mode 100644 index 00000000..90227498 --- /dev/null +++ b/lib/templates_old/python/library.hbs @@ -0,0 +1,17 @@ +# encoding: UTF-8 + +from behave import * + + +class {{capitalize rendered_children.name}}Library:{{#indent}} +__instance = None + +def __new__(cls, context):{{#indent}} +if {{capitalize rendered_children.name}}Library.__instance is None{{#indent}} +{{capitalize rendered_children.name}}Library.__instance = object.__new__(cls){{/indent}} + +return {{capitalize rendered_children.name}}Library.__instance{{/indent}} + +{{#each rendered_children.library_actionwords}}{{{this}}} +{{/each}} +{{/indent}} diff --git a/lib/templates_old/python/libraryactionword.hbs b/lib/templates_old/python/libraryactionword.hbs new file mode 100644 index 00000000..cd837e5d --- /dev/null +++ b/lib/templates_old/python/libraryactionword.hbs @@ -0,0 +1 @@ +{{> item_as_def}} diff --git a/lib/templates_old/python/list.hbs b/lib/templates_old/python/list.hbs new file mode 100644 index 00000000..4fe75940 --- /dev/null +++ b/lib/templates_old/python/list.hbs @@ -0,0 +1 @@ +[{{{ join rendered_children.items ', '}}}] \ No newline at end of file diff --git a/lib/templates_old/python/nullliteral.hbs b/lib/templates_old/python/nullliteral.hbs new file mode 100644 index 00000000..4af18322 --- /dev/null +++ b/lib/templates_old/python/nullliteral.hbs @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/lib/templates_old/python/parameter.hbs b/lib/templates_old/python/parameter.hbs new file mode 100644 index 00000000..fb19067f --- /dev/null +++ b/lib/templates_old/python/parameter.hbs @@ -0,0 +1 @@ +{{#trim_surrounding_characters "__"}}{{{ underscore rendered_children.name }}}{{/trim_surrounding_characters}}{{#if has_default_value?}} = {{{ rendered_children.default }}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/python/parenthesis.hbs b/lib/templates_old/python/parenthesis.hbs new file mode 100644 index 00000000..e99abc81 --- /dev/null +++ b/lib/templates_old/python/parenthesis.hbs @@ -0,0 +1 @@ +({{{ rendered_children.content }}}) \ No newline at end of file diff --git a/lib/templates_old/python/project.hbs b/lib/templates_old/python/project.hbs new file mode 100644 index 00000000..ac91589c --- /dev/null +++ b/lib/templates_old/python/project.hbs @@ -0,0 +1,2 @@ +name: {{{ rendered_children.name }}} +description: {{{ rendered_children.description }}} \ No newline at end of file diff --git a/lib/templates_old/python/property.hbs b/lib/templates_old/python/property.hbs new file mode 100644 index 00000000..d06d7910 --- /dev/null +++ b/lib/templates_old/python/property.hbs @@ -0,0 +1 @@ +'{{{ escape_single_quotes rendered_children.key }}}': {{{ rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates_old/python/scenario.hbs b/lib/templates_old/python/scenario.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/python/scenario.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates_old/python/scenarios.hbs b/lib/templates_old/python/scenarios.hbs new file mode 100644 index 00000000..6c5af2a0 --- /dev/null +++ b/lib/templates_old/python/scenarios.hbs @@ -0,0 +1,11 @@ +# encoding: UTF-8 +import unittest +from actionwords import Actionwords + +class Test{{{ camelize self_name }}}(unittest.TestCase): + def setUp(self): + self.actionwords = Actionwords(self) +{{#indent}} +{{#each rendered_children.scenarios}}{{{this}}} +{{/each}} +{{/indent}} diff --git a/lib/templates_old/python/single_scenario.hbs b/lib/templates_old/python/single_scenario.hbs new file mode 100644 index 00000000..87ce4c1b --- /dev/null +++ b/lib/templates_old/python/single_scenario.hbs @@ -0,0 +1,9 @@ +# encoding: UTF-8 +import unittest +from actionwords import Actionwords + +class Test{{{ camelize self_name }}}(unittest.TestCase): + def setUp(self): + self.actionwords = Actionwords(self) +{{#indent}} +{{> scenario}}{{/indent}} diff --git a/lib/templates_old/python/single_test.hbs b/lib/templates_old/python/single_test.hbs new file mode 100644 index 00000000..87ce4c1b --- /dev/null +++ b/lib/templates_old/python/single_test.hbs @@ -0,0 +1,9 @@ +# encoding: UTF-8 +import unittest +from actionwords import Actionwords + +class Test{{{ camelize self_name }}}(unittest.TestCase): + def setUp(self): + self.actionwords = Actionwords(self) +{{#indent}} +{{> scenario}}{{/indent}} diff --git a/lib/templates_old/python/step.hbs b/lib/templates_old/python/step.hbs new file mode 100644 index 00000000..e355ac74 --- /dev/null +++ b/lib/templates_old/python/step.hbs @@ -0,0 +1 @@ +{{#comment '#'}}TODO: Implement {{{ rendered_children.key }}}: {{{ rendered_children.value }}}{{/comment}} \ No newline at end of file diff --git a/lib/templates_old/python/tag.hbs b/lib/templates_old/python/tag.hbs new file mode 100644 index 00000000..a89d20fc --- /dev/null +++ b/lib/templates_old/python/tag.hbs @@ -0,0 +1 @@ +{{{ rendered_children.key }}}{{#if has_value?}}:{{{rendered_children.value}}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/python/template.hbs b/lib/templates_old/python/template.hbs new file mode 100644 index 00000000..4772fbfa --- /dev/null +++ b/lib/templates_old/python/template.hbs @@ -0,0 +1 @@ +"{{#each treated_chunks}}{{#if this.is_variable?}}%s{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"{{#if variable_names}} % ({{{ join variable_names ', '}}}){{/if}} \ No newline at end of file diff --git a/lib/templates_old/python/test.hbs b/lib/templates_old/python/test.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/python/test.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates_old/python/tests.hbs b/lib/templates_old/python/tests.hbs new file mode 100644 index 00000000..9ea10dbd --- /dev/null +++ b/lib/templates_old/python/tests.hbs @@ -0,0 +1,11 @@ +# encoding: UTF-8 +import unittest +from actionwords import Actionwords + +class Test{{{ camelize self_name }}}(unittest.TestCase): + def setUp(self): + self.actionwords = Actionwords(self) +{{#indent}} +{{#each rendered_children.tests}}{{{this}}} +{{/each}} +{{/indent}} diff --git a/lib/templates_old/python/unittest/actionwords.hbs b/lib/templates_old/python/unittest/actionwords.hbs new file mode 100644 index 00000000..c9593e39 --- /dev/null +++ b/lib/templates_old/python/unittest/actionwords.hbs @@ -0,0 +1,9 @@ +# encoding: UTF-8 + +class Actionwords:{{#indent}} +def __init__(self, test):{{#indent}} +self.test = test{{/indent}} + +{{#each rendered_children.actionwords}}{{{this}}} +{{/each}} +{{/indent}} diff --git a/lib/templates_old/python/while.hbs b/lib/templates_old/python/while.hbs new file mode 100644 index 00000000..df49e727 --- /dev/null +++ b/lib/templates_old/python/while.hbs @@ -0,0 +1,4 @@ +while ({{{ rendered_children.condition }}}):{{#indent}} +{{#each rendered_children.body }}{{{this}}} +{{/each}} +{{/indent}} \ No newline at end of file diff --git a/lib/templates/robotframework/_keyword.hbs b/lib/templates_old/robotframework/_keyword.hbs similarity index 100% rename from lib/templates/robotframework/_keyword.hbs rename to lib/templates_old/robotframework/_keyword.hbs diff --git a/lib/templates/robotframework/_keyword_body.hbs b/lib/templates_old/robotframework/_keyword_body.hbs similarity index 100% rename from lib/templates/robotframework/_keyword_body.hbs rename to lib/templates_old/robotframework/_keyword_body.hbs diff --git a/lib/templates/robotframework/_scenario.hbs b/lib/templates_old/robotframework/_scenario.hbs similarity index 100% rename from lib/templates/robotframework/_scenario.hbs rename to lib/templates_old/robotframework/_scenario.hbs diff --git a/lib/templates/robotframework/actionword.hbs b/lib/templates_old/robotframework/actionword.hbs similarity index 100% rename from lib/templates/robotframework/actionword.hbs rename to lib/templates_old/robotframework/actionword.hbs diff --git a/lib/templates/robotframework/actionwords.hbs b/lib/templates_old/robotframework/actionwords.hbs similarity index 100% rename from lib/templates/robotframework/actionwords.hbs rename to lib/templates_old/robotframework/actionwords.hbs diff --git a/lib/templates_old/robotframework/argument.hbs b/lib/templates_old/robotframework/argument.hbs new file mode 100644 index 00000000..67fa5119 --- /dev/null +++ b/lib/templates_old/robotframework/argument.hbs @@ -0,0 +1 @@ +{{{escape_new_line rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates/robotframework/call.hbs b/lib/templates_old/robotframework/call.hbs similarity index 100% rename from lib/templates/robotframework/call.hbs rename to lib/templates_old/robotframework/call.hbs diff --git a/lib/templates/robotframework/dataset.hbs b/lib/templates_old/robotframework/dataset.hbs similarity index 100% rename from lib/templates/robotframework/dataset.hbs rename to lib/templates_old/robotframework/dataset.hbs diff --git a/lib/templates_old/robotframework/datatable.hbs b/lib/templates_old/robotframework/datatable.hbs new file mode 100644 index 00000000..8dabf60c --- /dev/null +++ b/lib/templates_old/robotframework/datatable.hbs @@ -0,0 +1,2 @@ +{{#each rendered_children.datasets}}{{{this}}} +{{/each}} \ No newline at end of file diff --git a/lib/templates/robotframework/folder.hbs b/lib/templates_old/robotframework/folder.hbs similarity index 100% rename from lib/templates/robotframework/folder.hbs rename to lib/templates_old/robotframework/folder.hbs diff --git a/lib/templates/robotframework/ifthen.hbs b/lib/templates_old/robotframework/ifthen.hbs similarity index 100% rename from lib/templates/robotframework/ifthen.hbs rename to lib/templates_old/robotframework/ifthen.hbs diff --git a/lib/templates/robotframework/parameter.hbs b/lib/templates_old/robotframework/parameter.hbs similarity index 100% rename from lib/templates/robotframework/parameter.hbs rename to lib/templates_old/robotframework/parameter.hbs diff --git a/lib/templates_old/robotframework/property.hbs b/lib/templates_old/robotframework/property.hbs new file mode 100644 index 00000000..a0115375 --- /dev/null +++ b/lib/templates_old/robotframework/property.hbs @@ -0,0 +1 @@ +{{{ rendered_children.key }}}: {{{ rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates/robotframework/scenarios.hbs b/lib/templates_old/robotframework/scenarios.hbs similarity index 100% rename from lib/templates/robotframework/scenarios.hbs rename to lib/templates_old/robotframework/scenarios.hbs diff --git a/lib/templates/robotframework/single_scenario.hbs b/lib/templates_old/robotframework/single_scenario.hbs similarity index 100% rename from lib/templates/robotframework/single_scenario.hbs rename to lib/templates_old/robotframework/single_scenario.hbs diff --git a/lib/templates/robotframework/single_test.hbs b/lib/templates_old/robotframework/single_test.hbs similarity index 100% rename from lib/templates/robotframework/single_test.hbs rename to lib/templates_old/robotframework/single_test.hbs diff --git a/lib/templates_old/robotframework/stringliteral.hbs b/lib/templates_old/robotframework/stringliteral.hbs new file mode 100644 index 00000000..65f2c1bb --- /dev/null +++ b/lib/templates_old/robotframework/stringliteral.hbs @@ -0,0 +1 @@ +{{ rendered_children.value }} \ No newline at end of file diff --git a/lib/templates/robotframework/template.hbs b/lib/templates_old/robotframework/template.hbs similarity index 100% rename from lib/templates/robotframework/template.hbs rename to lib/templates_old/robotframework/template.hbs diff --git a/lib/templates/robotframework/test.hbs b/lib/templates_old/robotframework/test.hbs similarity index 100% rename from lib/templates/robotframework/test.hbs rename to lib/templates_old/robotframework/test.hbs diff --git a/lib/templates/robotframework/tests.hbs b/lib/templates_old/robotframework/tests.hbs similarity index 100% rename from lib/templates/robotframework/tests.hbs rename to lib/templates_old/robotframework/tests.hbs diff --git a/lib/templates/robotframework/variable.hbs b/lib/templates_old/robotframework/variable.hbs similarity index 100% rename from lib/templates/robotframework/variable.hbs rename to lib/templates_old/robotframework/variable.hbs diff --git a/lib/templates/robotframework/while.hbs b/lib/templates_old/robotframework/while.hbs similarity index 100% rename from lib/templates/robotframework/while.hbs rename to lib/templates_old/robotframework/while.hbs diff --git a/lib/templates_old/ruby/_body.hbs b/lib/templates_old/ruby/_body.hbs new file mode 100644 index 00000000..f6cd17f6 --- /dev/null +++ b/lib/templates_old/ruby/_body.hbs @@ -0,0 +1,10 @@ +{{#clear_empty_lines}} +{{#indent}} +{{#comment '#'}}{{#if has_description?}}{{{ rendered_children.description }}} +{{/if}}{{#if has_tags?}}Tags: {{{ join rendered_children.tags ' '}}} +{{/if}}{{/comment}} +{{#each rendered_children.body}}{{{this}}} +{{/each}} +{{#if has_step?}}raise NotImplementedError{{/if}} +{{/indent}} +{{/clear_empty_lines}} \ No newline at end of file diff --git a/lib/templates_old/ruby/_item_as_def.hbs b/lib/templates_old/ruby/_item_as_def.hbs new file mode 100644 index 00000000..8e75707c --- /dev/null +++ b/lib/templates_old/ruby/_item_as_def.hbs @@ -0,0 +1,3 @@ +def {{ underscore rendered_children.name }}{{#if has_parameters?}}({{{ join rendered_children.parameters ', '}}}){{/if}} +{{> body}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/_scenario.hbs b/lib/templates_old/ruby/_scenario.hbs new file mode 100644 index 00000000..fc7bda2c --- /dev/null +++ b/lib/templates_old/ruby/_scenario.hbs @@ -0,0 +1,5 @@ +{{#if has_datasets?}}context "{{{ escape_double_quotes self_name }}}" do{{#indent}} +{{> item_as_def}} +{{{ rendered_children.datatable }}}{{/indent}}{{else}}it "{{{ escape_double_quotes self_name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}" do +{{> body}}{{/if}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/actionword.hbs b/lib/templates_old/ruby/actionword.hbs new file mode 100644 index 00000000..18e12272 --- /dev/null +++ b/lib/templates_old/ruby/actionword.hbs @@ -0,0 +1 @@ +{{> item_as_def}} \ No newline at end of file diff --git a/lib/templates_old/ruby/actionwords.hbs b/lib/templates_old/ruby/actionwords.hbs new file mode 100644 index 00000000..51d11c09 --- /dev/null +++ b/lib/templates_old/ruby/actionwords.hbs @@ -0,0 +1,6 @@ +# encoding: UTF-8 + +module Actionwords{{#indent}}{{#each rendered_children.actionwords}} +{{{this}}} +{{/each}}{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/argument.hbs b/lib/templates_old/ruby/argument.hbs new file mode 100644 index 00000000..67fa5119 --- /dev/null +++ b/lib/templates_old/ruby/argument.hbs @@ -0,0 +1 @@ +{{{escape_new_line rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates_old/ruby/assign.hbs b/lib/templates_old/ruby/assign.hbs new file mode 100644 index 00000000..7b7f3bbe --- /dev/null +++ b/lib/templates_old/ruby/assign.hbs @@ -0,0 +1 @@ +{{{ rendered_children.to }}} = {{{ rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates_old/ruby/binaryexpression.hbs b/lib/templates_old/ruby/binaryexpression.hbs new file mode 100644 index 00000000..f0147c66 --- /dev/null +++ b/lib/templates_old/ruby/binaryexpression.hbs @@ -0,0 +1 @@ +{{{ rendered_children.left }}} {{{ rendered_children.operator }}} {{{ rendered_children.right }}} \ No newline at end of file diff --git a/lib/templates_old/ruby/call.hbs b/lib/templates_old/ruby/call.hbs new file mode 100644 index 00000000..ff439423 --- /dev/null +++ b/lib/templates_old/ruby/call.hbs @@ -0,0 +1,2 @@ +{{#if has_annotation? }}{{#comment '#'}}{{{ rendered_children.gherkin_text }}}{{/comment}} +{{/if}}{{{ underscore rendered_children.actionword }}}{{#if has_arguments?}}({{{ join rendered_children.all_arguments ', '}}}){{/if}} \ No newline at end of file diff --git a/lib/templates_old/ruby/dataset.hbs b/lib/templates_old/ruby/dataset.hbs new file mode 100644 index 00000000..4dc559a7 --- /dev/null +++ b/lib/templates_old/ruby/dataset.hbs @@ -0,0 +1,3 @@ +it "{{{escape_double_quotes rendered_children.name}}}{{#if rendered_children.test_snapshot_uid}} (uid:{{{rendered_children.test_snapshot_uid}}}){{/if}}" do + {{{ underscore scenario_name }}}({{{ join rendered_children.arguments ', ' }}}) +end \ No newline at end of file diff --git a/lib/templates_old/ruby/dict.hbs b/lib/templates_old/ruby/dict.hbs new file mode 100644 index 00000000..d6824356 --- /dev/null +++ b/lib/templates_old/ruby/dict.hbs @@ -0,0 +1 @@ +{{#curly}}{{{ join rendered_children.items ', '}}}{{/curly}} \ No newline at end of file diff --git a/lib/templates_old/ruby/field.hbs b/lib/templates_old/ruby/field.hbs new file mode 100644 index 00000000..23e02b80 --- /dev/null +++ b/lib/templates_old/ruby/field.hbs @@ -0,0 +1 @@ +{{{ rendered_children.base }}}.{{{ rendered_children.name }}} \ No newline at end of file diff --git a/lib/templates_old/ruby/folder.hbs b/lib/templates_old/ruby/folder.hbs new file mode 100644 index 00000000..07239836 --- /dev/null +++ b/lib/templates_old/ruby/folder.hbs @@ -0,0 +1,16 @@ +# encoding: UTF-8 +require 'spec_helper' +require_relative '{{{ relative_path 'actionwords' }}}' + +describe '{{{ escape_single_quotes self_name }}}' do{{#indent}} +include Actionwords + +{{#unless is_empty?}}before(:each) do +{{> body}} +end + +{{/unless}}{{#each rendered_children.scenarios}}{{{this}}} + +{{/each}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/ifthen.hbs b/lib/templates_old/ruby/ifthen.hbs new file mode 100644 index 00000000..b227c97b --- /dev/null +++ b/lib/templates_old/ruby/ifthen.hbs @@ -0,0 +1,7 @@ +if ({{{ rendered_children.condition }}}) +{{#indent}}{{#each rendered_children.then}}{{{this}}}{{/each}} +{{/indent}} +{{#if has_else?}}else +{{#indent}}{{#each rendered_children.else}}{{{this}}}{{/each}} +{{/indent}} +{{/if}}end \ No newline at end of file diff --git a/lib/templates_old/ruby/index.hbs b/lib/templates_old/ruby/index.hbs new file mode 100644 index 00000000..8521d3fa --- /dev/null +++ b/lib/templates_old/ruby/index.hbs @@ -0,0 +1 @@ +{{{ rendered_children.base }}}[{{{ rendered_children.expression }}}] \ No newline at end of file diff --git a/lib/templates_old/ruby/list.hbs b/lib/templates_old/ruby/list.hbs new file mode 100644 index 00000000..4fe75940 --- /dev/null +++ b/lib/templates_old/ruby/list.hbs @@ -0,0 +1 @@ +[{{{ join rendered_children.items ', '}}}] \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/_item_as_def.hbs b/lib/templates_old/ruby/minitest/_item_as_def.hbs new file mode 100644 index 00000000..8e75707c --- /dev/null +++ b/lib/templates_old/ruby/minitest/_item_as_def.hbs @@ -0,0 +1,3 @@ +def {{ underscore rendered_children.name }}{{#if has_parameters?}}({{{ join rendered_children.parameters ', '}}}){{/if}} +{{> body}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/_scenario.hbs b/lib/templates_old/ruby/minitest/_scenario.hbs new file mode 100644 index 00000000..5de18a78 --- /dev/null +++ b/lib/templates_old/ruby/minitest/_scenario.hbs @@ -0,0 +1,4 @@ +{{#if has_datasets?}}{{> item_as_def}} +{{{ rendered_children.datatable }}}{{else}}def test_{{{ normalize rendered_children.name }}}{{#if rendered_children.uid}}_uid{{{ normalize rendered_children.uid}}}{{/if}} +{{> body}} +end{{/if}} \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/dataset.hbs b/lib/templates_old/ruby/minitest/dataset.hbs new file mode 100644 index 00000000..667c34ba --- /dev/null +++ b/lib/templates_old/ruby/minitest/dataset.hbs @@ -0,0 +1,3 @@ +def test_{{{ normalize scenario_name}}}_{{{ normalize_lower rendered_children.name}}}{{#if rendered_children.test_snapshot_uid}}_uid{{{ normalize rendered_children.test_snapshot_uid}}}{{/if}} + {{{ underscore scenario_name }}}({{{ join rendered_children.arguments ', ' }}}) +end \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/folder.hbs b/lib/templates_old/ruby/minitest/folder.hbs new file mode 100644 index 00000000..ce0766b5 --- /dev/null +++ b/lib/templates_old/ruby/minitest/folder.hbs @@ -0,0 +1,18 @@ +# encoding: UTF-8 + +require 'minitest/autorun' +require_relative '{{{ relative_path 'actionwords' }}}' + +class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase{{#indent}} +include Actionwords + +{{#unless is_empty?}}def setup{{#indent}} +{{> body}} +{{/indent}} +end + +{{/unless}}{{#each rendered_children.scenarios}}{{{this}}} + +{{/each}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/scenario.hbs b/lib/templates_old/ruby/minitest/scenario.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/ruby/minitest/scenario.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/scenarios.hbs b/lib/templates_old/ruby/minitest/scenarios.hbs new file mode 100644 index 00000000..ba3858c8 --- /dev/null +++ b/lib/templates_old/ruby/minitest/scenarios.hbs @@ -0,0 +1,13 @@ +# encoding: UTF-8 + +require 'minitest/autorun' +require_relative 'actionwords' + +class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase + include Actionwords +{{#indent}} +{{#each rendered_children.scenarios}}{{{this}}} + +{{/each}} +{{/indent}} +end diff --git a/lib/templates_old/ruby/minitest/single_scenario.hbs b/lib/templates_old/ruby/minitest/single_scenario.hbs new file mode 100644 index 00000000..f8e5f7d4 --- /dev/null +++ b/lib/templates_old/ruby/minitest/single_scenario.hbs @@ -0,0 +1,11 @@ +# encoding: UTF-8 + +require 'minitest/autorun' +require_relative '{{{ relative_path 'actionwords' }}}' + +class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase + include Actionwords +{{#indent}} +{{> scenario}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/single_test.hbs b/lib/templates_old/ruby/minitest/single_test.hbs new file mode 100644 index 00000000..df79947a --- /dev/null +++ b/lib/templates_old/ruby/minitest/single_test.hbs @@ -0,0 +1,11 @@ +# encoding: UTF-8 + +require 'minitest/autorun' +require_relative 'actionwords' + +class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase + include Actionwords +{{#indent}} +{{> scenario}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/test.hbs b/lib/templates_old/ruby/minitest/test.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/ruby/minitest/test.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates_old/ruby/minitest/tests.hbs b/lib/templates_old/ruby/minitest/tests.hbs new file mode 100644 index 00000000..a806ab3b --- /dev/null +++ b/lib/templates_old/ruby/minitest/tests.hbs @@ -0,0 +1,13 @@ +# encoding: UTF-8 + +require 'minitest/autorun' +require_relative 'actionwords' + +class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase + include Actionwords +{{#indent}} +{{#each rendered_children.tests}}{{{this}}} + +{{/each}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/parameter.hbs b/lib/templates_old/ruby/parameter.hbs new file mode 100644 index 00000000..5b612f9c --- /dev/null +++ b/lib/templates_old/ruby/parameter.hbs @@ -0,0 +1 @@ +{{{ underscore rendered_children.name }}}{{#if has_default_value?}} = {{{ rendered_children.default }}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/ruby/parenthesis.hbs b/lib/templates_old/ruby/parenthesis.hbs new file mode 100644 index 00000000..e99abc81 --- /dev/null +++ b/lib/templates_old/ruby/parenthesis.hbs @@ -0,0 +1 @@ +({{{ rendered_children.content }}}) \ No newline at end of file diff --git a/lib/templates_old/ruby/project.hbs b/lib/templates_old/ruby/project.hbs new file mode 100644 index 00000000..ac91589c --- /dev/null +++ b/lib/templates_old/ruby/project.hbs @@ -0,0 +1,2 @@ +name: {{{ rendered_children.name }}} +description: {{{ rendered_children.description }}} \ No newline at end of file diff --git a/lib/templates_old/ruby/property.hbs b/lib/templates_old/ruby/property.hbs new file mode 100644 index 00000000..a0115375 --- /dev/null +++ b/lib/templates_old/ruby/property.hbs @@ -0,0 +1 @@ +{{{ rendered_children.key }}}: {{{ rendered_children.value }}} \ No newline at end of file diff --git a/lib/templates_old/ruby/scenario.hbs b/lib/templates_old/ruby/scenario.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/ruby/scenario.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates_old/ruby/scenarios.hbs b/lib/templates_old/ruby/scenarios.hbs new file mode 100644 index 00000000..13f37dd5 --- /dev/null +++ b/lib/templates_old/ruby/scenarios.hbs @@ -0,0 +1,12 @@ +# encoding: UTF-8 +require 'spec_helper' +require_relative 'actionwords' + +describe '{{{ escape_single_quotes self_name }}}' do + include Actionwords +{{#indent}} +{{#each rendered_children.scenarios}}{{{this}}} + +{{/each}} +{{/indent}} +end diff --git a/lib/templates_old/ruby/single_scenario.hbs b/lib/templates_old/ruby/single_scenario.hbs new file mode 100644 index 00000000..70a10653 --- /dev/null +++ b/lib/templates_old/ruby/single_scenario.hbs @@ -0,0 +1,11 @@ +# encoding: UTF-8 +require 'spec_helper' +require_relative '{{{ relative_path 'actionwords' }}}' + +describe '{{{ escape_single_quotes self_name }}}' do + include Actionwords + +{{#indent}} +{{> scenario}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/single_test.hbs b/lib/templates_old/ruby/single_test.hbs new file mode 100644 index 00000000..ad500dd2 --- /dev/null +++ b/lib/templates_old/ruby/single_test.hbs @@ -0,0 +1,11 @@ +# encoding: UTF-8 +require 'spec_helper' +require_relative 'actionwords' + +describe '{{{ escape_single_quotes self_name }}}' do + include Actionwords + +{{#indent}} +{{> scenario}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/step.hbs b/lib/templates_old/ruby/step.hbs new file mode 100644 index 00000000..a4f8d690 --- /dev/null +++ b/lib/templates_old/ruby/step.hbs @@ -0,0 +1 @@ +{{#comment '#'}}TODO: Implement {{{rendered_children.key}}}: {{{rendered_children.value}}}{{/comment}} \ No newline at end of file diff --git a/lib/templates_old/ruby/symbol.hbs b/lib/templates_old/ruby/symbol.hbs new file mode 100644 index 00000000..0134b1e2 --- /dev/null +++ b/lib/templates_old/ruby/symbol.hbs @@ -0,0 +1 @@ +:{{rendered_children.delimiter}}{{to_string rendered_children.value }}{{rendered_children.delimiter}} \ No newline at end of file diff --git a/lib/templates_old/ruby/tag.hbs b/lib/templates_old/ruby/tag.hbs new file mode 100644 index 00000000..a89d20fc --- /dev/null +++ b/lib/templates_old/ruby/tag.hbs @@ -0,0 +1 @@ +{{{ rendered_children.key }}}{{#if has_value?}}:{{{rendered_children.value}}}{{/if}} \ No newline at end of file diff --git a/lib/templates_old/ruby/template.hbs b/lib/templates_old/ruby/template.hbs new file mode 100644 index 00000000..7353a8fd --- /dev/null +++ b/lib/templates_old/ruby/template.hbs @@ -0,0 +1 @@ +"{{#each treated_chunks}}{{#if this.is_variable?}}#{{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}" \ No newline at end of file diff --git a/lib/templates_old/ruby/test.hbs b/lib/templates_old/ruby/test.hbs new file mode 100644 index 00000000..24c71263 --- /dev/null +++ b/lib/templates_old/ruby/test.hbs @@ -0,0 +1 @@ +{{> scenario}} \ No newline at end of file diff --git a/lib/templates_old/ruby/tests.hbs b/lib/templates_old/ruby/tests.hbs new file mode 100644 index 00000000..950f4c47 --- /dev/null +++ b/lib/templates_old/ruby/tests.hbs @@ -0,0 +1,12 @@ +# encoding: UTF-8 +require 'spec_helper' +require_relative 'actionwords' + +describe '{{{ escape_single_quotes self_name }}}' do + include Actionwords +{{#indent}} +{{#each rendered_children.tests}}{{{this}}} + +{{/each}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates_old/ruby/while.hbs b/lib/templates_old/ruby/while.hbs new file mode 100644 index 00000000..b1cb543d --- /dev/null +++ b/lib/templates_old/ruby/while.hbs @@ -0,0 +1,5 @@ +while ({{{ rendered_children.condition }}}){{#indent}} +{{#each rendered_children.body }}{{{this}}} +{{/each}} +{{/indent}} +end \ No newline at end of file diff --git a/lib/templates/seleniumide/argument.hbs b/lib/templates_old/seleniumide/argument.hbs similarity index 100% rename from lib/templates/seleniumide/argument.hbs rename to lib/templates_old/seleniumide/argument.hbs diff --git a/lib/templates/seleniumide/call.hbs b/lib/templates_old/seleniumide/call.hbs similarity index 100% rename from lib/templates/seleniumide/call.hbs rename to lib/templates_old/seleniumide/call.hbs diff --git a/lib/templates/seleniumide/single_test.hbs b/lib/templates_old/seleniumide/single_test.hbs similarity index 100% rename from lib/templates/seleniumide/single_test.hbs rename to lib/templates_old/seleniumide/single_test.hbs diff --git a/lib/templates_old/seleniumide/step.hbs b/lib/templates_old/seleniumide/step.hbs new file mode 100644 index 00000000..e69de29b diff --git a/lib/templates/seleniumide/stringliteral.hbs b/lib/templates_old/seleniumide/stringliteral.hbs similarity index 100% rename from lib/templates/seleniumide/stringliteral.hbs rename to lib/templates_old/seleniumide/stringliteral.hbs diff --git a/lib/templates/seleniumide/template.hbs b/lib/templates_old/seleniumide/template.hbs similarity index 100% rename from lib/templates/seleniumide/template.hbs rename to lib/templates_old/seleniumide/template.hbs diff --git a/lib/templates/seleniumide/test.hbs b/lib/templates_old/seleniumide/test.hbs similarity index 100% rename from lib/templates/seleniumide/test.hbs rename to lib/templates_old/seleniumide/test.hbs diff --git a/lib/templates/seleniumide/tests.hbs b/lib/templates_old/seleniumide/tests.hbs similarity index 100% rename from lib/templates/seleniumide/tests.hbs rename to lib/templates_old/seleniumide/tests.hbs diff --git a/lib/templates/specflow/actionword.hbs b/lib/templates_old/specflow/actionword.hbs similarity index 100% rename from lib/templates/specflow/actionword.hbs rename to lib/templates_old/specflow/actionword.hbs diff --git a/lib/templates/specflow/actionwords.hbs b/lib/templates_old/specflow/actionwords.hbs similarity index 100% rename from lib/templates/specflow/actionwords.hbs rename to lib/templates_old/specflow/actionwords.hbs diff --git a/lib/templates/specflow/actionwords/parameter.hbs b/lib/templates_old/specflow/actionwords/parameter.hbs similarity index 100% rename from lib/templates/specflow/actionwords/parameter.hbs rename to lib/templates_old/specflow/actionwords/parameter.hbs diff --git a/lib/templates/specflow/gherkin/tag.hbs b/lib/templates_old/specflow/gherkin/tag.hbs similarity index 100% rename from lib/templates/specflow/gherkin/tag.hbs rename to lib/templates_old/specflow/gherkin/tag.hbs diff --git a/lib/templates/specflow/parameter.hbs b/lib/templates_old/specflow/parameter.hbs similarity index 100% rename from lib/templates/specflow/parameter.hbs rename to lib/templates_old/specflow/parameter.hbs diff --git a/lib/templates/typescript/_item_as_function.hbs b/lib/templates_old/typescript/_item_as_function.hbs similarity index 100% rename from lib/templates/typescript/_item_as_function.hbs rename to lib/templates_old/typescript/_item_as_function.hbs diff --git a/lib/templates_old/typescript/actionword.hbs b/lib/templates_old/typescript/actionword.hbs new file mode 100755 index 00000000..d7d4d5dd --- /dev/null +++ b/lib/templates_old/typescript/actionword.hbs @@ -0,0 +1 @@ +{{> item_as_function}} \ No newline at end of file diff --git a/lib/templates/typescript/actionwords.hbs b/lib/templates_old/typescript/actionwords.hbs similarity index 100% rename from lib/templates/typescript/actionwords.hbs rename to lib/templates_old/typescript/actionwords.hbs diff --git a/lib/templates/typescript/libraries.hbs b/lib/templates_old/typescript/libraries.hbs similarity index 100% rename from lib/templates/typescript/libraries.hbs rename to lib/templates_old/typescript/libraries.hbs diff --git a/lib/templates/typescript/library.hbs b/lib/templates_old/typescript/library.hbs similarity index 100% rename from lib/templates/typescript/library.hbs rename to lib/templates_old/typescript/library.hbs diff --git a/lib/templates/typescript/libraryactionword.hbs b/lib/templates_old/typescript/libraryactionword.hbs similarity index 100% rename from lib/templates/typescript/libraryactionword.hbs rename to lib/templates_old/typescript/libraryactionword.hbs diff --git a/lib/templates/typescript/parameter.hbs b/lib/templates_old/typescript/parameter.hbs similarity index 100% rename from lib/templates/typescript/parameter.hbs rename to lib/templates_old/typescript/parameter.hbs diff --git a/spec/fixtures/lib/templates/common/empty.hbs b/spec/fixtures/lib/templates/common/empty.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/common/stringliteral.hbs b/spec/fixtures/lib/templates/common/stringliteral.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/actionwords/actionword.hbs b/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/actionwords/actionword.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/actionwords/assign.hbs b/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/actionwords/assign.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/assign.hbs b/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/assign.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/actionword.hbs b/spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/step_definitions/actionword.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/frameworks/minitest/version-5.0/scenarios.hbs b/spec/fixtures/lib/templates/frameworks/minitest/version-5.0/scenarios.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/frameworks/minitest/version-7.0/scenarios.hbs b/spec/fixtures/lib/templates/frameworks/minitest/version-7.0/scenarios.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/languages/java/version-7/actionword.hbs b/spec/fixtures/lib/templates/languages/java/version-7/actionword.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/languages/python/version-2.7/scenarios.hbs b/spec/fixtures/lib/templates/languages/python/version-2.7/scenarios.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/languages/ruby/version-2.3/assign.hbs b/spec/fixtures/lib/templates/languages/ruby/version-2.3/assign.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/languages/ruby/version-2.3/dict.hbs b/spec/fixtures/lib/templates/languages/ruby/version-2.3/dict.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/languages/ruby/version-2.3/use_arrow_for_dict_flavor/dict.hbs b/spec/fixtures/lib/templates/languages/ruby/version-2.3/use_arrow_for_dict_flavor/dict.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/lib/templates/languages/ruby/version-2.7/assign.hbs b/spec/fixtures/lib/templates/languages/ruby/version-2.7/assign.hbs new file mode 100644 index 00000000..e69de29b diff --git a/spec/render_shared.rb b/spec/render_shared.rb index 36fc39f9..7251e51f 100644 --- a/spec/render_shared.rb +++ b/spec/render_shared.rb @@ -1967,6 +1967,7 @@ def rendering(node) framework: framework ) } + context 'the __datatable parameter' do let(:node_to_render) { make_actionword( diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0f48264a..e1454c49 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,9 @@ require 'i18n/coverage' require 'securerandom' +require 'i18n' +I18n.load_path << Dir["./config/locales/*.yml"] + begin require 'pry' rescue LoadError => exception diff --git a/spec/template_finder_spec.rb b/spec/template_finder_spec.rb index 192ddbae..7e4cc1bb 100644 --- a/spec/template_finder_spec.rb +++ b/spec/template_finder_spec.rb @@ -1,22 +1,91 @@ require 'spec_helper' -require_relative '../lib/hiptest-publisher/options_parser' +require_relative '../lib/hiptest-publisher/template_finder' describe TemplateFinder do + before do + allow_any_instance_of(TemplateFinder).to receive(:hiptest_publisher_path).and_return("./spec/fixtures") + end + context '#get_template_path' do it 'checks if the file exists in the common templates' do - template_finder = context_for(language: 'python').template_finder - expect(template_finder.get_template_path('stringliteral')).to eq('./lib/templates/common/stringliteral.hbs') + template_finder = TemplateFinder.new(template_dirs: ['python-unittest', 'python', 'common']) + expect(template_finder.get_template_path('stringliteral')).to eq('./spec/fixtures/lib/templates/common/stringliteral.hbs') end it 'looks in the language template folder' do - template_finder = context_for(language: 'ruby').template_finder - expect(template_finder.get_template_path('stringliteral')).to eq('./lib/templates/common/stringliteral.hbs') - expect(template_finder.get_template_path('assign')).to eq('./lib/templates/ruby/assign.hbs') + template_finder = TemplateFinder.new(template_dirs: ['rspec', 'ruby', 'common']) + expect(template_finder.get_template_path('stringliteral')).to eq('./spec/fixtures/lib/templates/common/stringliteral.hbs') + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.3/assign.hbs') end it 'looks in the framework specific folder if existing' do - template_finder = context_for(language: 'ruby', framework: 'minitest').template_finder - expect(template_finder.get_template_path('scenarios')).to eq('./lib/templates/ruby/minitest/scenarios.hbs') + template_finder = TemplateFinder.new(template_dirs: ['minitest', 'ruby', 'common']) + expect(template_finder.get_template_path('scenarios')).to eq('./spec/fixtures/lib/templates/frameworks/minitest/version-5.0/scenarios.hbs') + end + + context 'when multiple versions of the language are available' do + it 'picks the first one in the list by default' do + template_finder = TemplateFinder.new(template_dirs: ['rspec', 'ruby', 'common']) + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.3/assign.hbs') + end + + it 'selects the one specified if available' do + template_finder = TemplateFinder.new(template_dirs: ['rspec', 'ruby', 'common'], ruby_version: '2.7') + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.7/assign.hbs') + end + + it 'picks the first one if the selected one does not exist' do + template_finder = TemplateFinder.new(template_dirs: ['rspec', 'ruby', 'common'], ruby_version: '4.7') + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.3/assign.hbs') + end + end + + context 'when multiple versions of the framework are available' do + it 'picks the first one in the list by default' do + template_finder = TemplateFinder.new(template_dirs: ['minitest', 'ruby', 'common']) + expect(template_finder.get_template_path('scenarios')).to eq('./spec/fixtures/lib/templates/frameworks/minitest/version-5.0/scenarios.hbs') + end + + it 'selects the one specified if available' do + template_finder = TemplateFinder.new(template_dirs: ['minitest', 'ruby', 'common'], minitest_version: '7.0') + expect(template_finder.get_template_path('scenarios')).to eq('./spec/fixtures/lib/templates/frameworks/minitest/version-7.0/scenarios.hbs') + end + + it 'picks the first one if the selected one does not exist' do + template_finder = TemplateFinder.new(template_dirs: ['minitest', 'ruby', 'common'], minitest_version: '17.0') + expect(template_finder.get_template_path('scenarios')).to eq('./spec/fixtures/lib/templates/frameworks/minitest/version-5.0/scenarios.hbs') + end + end + + context 'when flavors are provided' do + it 'will check for templates inside // first' do + template_finder = TemplateFinder.new(template_dirs: ['ruby'], ruby_flavors: ['use_arrow_for_dict']) + expect(template_finder.get_template_path('dict')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.3/use_arrow_for_dict_flavor/dict.hbs') + end + + it 'does not fail when the flavor does not exist' do + template_finder = TemplateFinder.new(template_dirs: ['ruby'], ruby_flavors: ['inline_uids']) + expect(template_finder.get_template_path('dict')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.3/dict.hbs') + end + + it 'uses the main directory if the template is not overriden by the flavor' do + template_finder = TemplateFinder.new(template_dirs: ['ruby'], ruby_flavors: ['use_arrow_for_dict']) + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/languages/ruby/version-2.3/assign.hbs') + end + end + + context 'when specific sub folders exists for language group' do + it 'picks the template in that sub-folder if the language group is the correct one' do + template_finder = TemplateFinder.new(template_dirs: ['cucumber-java', 'java', 'common'], language_group: 'actionwords') + + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/actionwords/assign.hbs') + end + + it 'picks the root one if there is none for the group' do + template_finder = TemplateFinder.new(template_dirs: ['cucumber-java', 'java', 'common'], language_group: 'step_definitions') + + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/frameworks/cucumber-java/version-1.2/assign.hbs') + end end context 'when option[:overriden_templates] is set' do @@ -35,11 +104,11 @@ # create a new one each time because it is stateful def template_finder - context_for(language: 'python', overriden_templates: overriden_templates_dir).template_finder + template_finder = TemplateFinder.new(template_dirs: ['python-unittest', 'python', 'common'], overriden_templates: overriden_templates_dir) end it 'if no matching template file found in overriden templates dir, it uses the default template file' do - expect(template_finder.get_template_path('scenarios')).to eq('./lib/templates/python/scenarios.hbs') + expect(template_finder.get_template_path('scenarios')).to eq('./spec/fixtures/lib/templates/languages/python/version-2.7/scenarios.hbs') end it 'if matching template file found in overriden templates dir, it uses the overriden template file' do @@ -49,33 +118,21 @@ def template_finder it 'looks for template in overriden templates base dir first' do FileUtils.touch("#{overriden_templates_dir}/actionwords.hbs") - FileUtils.touch("#{overriden_templates_dir}/python/unittest/actionwords.hbs") - FileUtils.touch("#{overriden_templates_dir}/python/actionwords.hbs") + FileUtils.mkdir_p("#{overriden_templates_dir}/frameworks/python-unittest/version-2.7") + FileUtils.touch("#{overriden_templates_dir}/frameworks/python-unittest/version-2.7/actionwords.hbs") expect(template_finder.get_template_path('actionwords')).to eq("#{overriden_templates_dir}/actionwords.hbs") end - - it 'looks for template in each template subdirectory, both in overriden templates and hiptest-publisher template' do - FileUtils.touch("#{overriden_templates_dir}/python/unittest/actionwords.hbs") - FileUtils.touch("#{overriden_templates_dir}/python/actionwords.hbs") - expect(template_finder.get_template_path('actionwords')).to eq("#{overriden_templates_dir}/python/unittest/actionwords.hbs") - - # if removing the overriden_template/python/unittest/actionwords.hbs file, - # it should pick the hiptest publisher one - # it should not pick the overriden_template/python/unittestactionwords.hbs one - FileUtils.rm("#{overriden_templates_dir}/python/unittest/actionwords.hbs") - expect(template_finder.get_template_path('actionwords')).to eq("./lib/templates/python/unittest/actionwords.hbs") - end end context 'when option[:fallback_template] is set' do it 'uses the given fallback template if no template is found' do - template_finder = context_for(only: 'features', language: 'cucumber', fallback_template: "empty").template_finder - expect(template_finder.get_template_path('assign')).to eq('./lib/templates/common/empty.hbs') + template_finder = TemplateFinder.new(template_dirs: ['python-unittest', 'python', 'common'], fallback_template: 'empty') + expect(template_finder.get_template_path('assign')).to eq('./spec/fixtures/lib/templates/common/empty.hbs') end it 'still uses the template if found' do - template_finder = context_for(only: 'features', language: 'cucumber', fallback_template: "empty").template_finder - expect(template_finder.get_template_path('stringliteral')).to eq('./lib/templates/gherkin/stringliteral.hbs') + template_finder = TemplateFinder.new(template_dirs: ['python-unittest', 'python', 'common'], fallback_template: 'empty') + expect(template_finder.get_template_path('scenarios')).to eq('./spec/fixtures/lib/templates/languages/python/version-2.7/scenarios.hbs') end end end