features/step_definitions/remi_step.rb in remi-0.2.39 vs features/step_definitions/remi_step.rb in remi-0.2.40
- old
+ new
@@ -2,11 +2,11 @@
# create another step definition file to contain application-specific steps.
### Job and background setup
Given /^the job is '([[:alnum:]\s]+)'$/ do |arg|
- @brt = Remi::BusinessRules::Tester.new(arg)
+ @brt = Remi::Testing::BusinessRules::Tester.new(arg)
end
Given /^the job source '([[:alnum:]\s\-_]+)'$/ do |arg|
@brt.add_job_source arg
end
@@ -62,33 +62,33 @@
Then /^the file that comes last in an alphanumeric sort by group will be downloaded for processing$/ do
expect(@brt.source.data_subject.extractor.most_recent_by).to eq :name
end
Then /^the file is uploaded to the remote path "([^"]+)"$/ do |remote_path|
- expect(@brt.target.get_attrib(:remote_path)).to eq Remi::BusinessRules::ParseFormula.parse(remote_path)
+ expect(@brt.target.get_attrib(:remote_path)).to eq Remi::Testing::BusinessRules::ParseFormula.parse(remote_path)
end
## CSV Options
Given /^the (source|target) file is delimited with a (\w+)$/ do |st, delimiter|
- expect(@brt.send(st.to_sym).csv_options[:col_sep]).to eq Remi::BusinessRules.csv_opt_map[delimiter]
+ expect(@brt.send(st.to_sym).csv_options[:col_sep]).to eq Remi::Testing::BusinessRules.csv_opt_map[delimiter]
end
Given /^the (source|target) file is encoded using "([^"]+)" format$/ do |st, encoding|
expect(@brt.send(st.to_sym).csv_options[:encoding].split(':').first).to eq encoding
end
Given /^the (source|target) file uses a ([\w ]+) to quote embedded delimiters$/ do |st, quote_char|
- expect(@brt.send(st.to_sym).csv_options[:quote_char]).to eq Remi::BusinessRules.csv_opt_map[quote_char]
+ expect(@brt.send(st.to_sym).csv_options[:quote_char]).to eq Remi::Testing::BusinessRules.csv_opt_map[quote_char]
end
Given /^the (source|target) file uses a preceding ([\w ]+) to escape an embedded quoting character$/ do |st, escape_char|
- expect(@brt.send(st.to_sym).csv_options[:quote_char]).to eq Remi::BusinessRules.csv_opt_map[escape_char]
+ expect(@brt.send(st.to_sym).csv_options[:quote_char]).to eq Remi::Testing::BusinessRules.csv_opt_map[escape_char]
end
Given /^the (source|target) file uses ([\w ]+) line endings$/ do |st, line_endings|
- expect(@brt.send(st.to_sym).csv_options[:row_sep]).to eq Remi::BusinessRules.csv_opt_map[line_endings]
+ expect(@brt.send(st.to_sym).csv_options[:row_sep]).to eq Remi::Testing::BusinessRules.csv_opt_map[line_endings]
end
Given /^the (source|target) file uses "([^"]+)" as a record separator$/ do |st, line_endings|
expect(@brt.send(st.to_sym).csv_options[:row_sep]).to eq line_endings.gsub(/\\n/, "\n").gsub(/\\r/, "\r")
end
@@ -128,11 +128,11 @@
Given /^the source field '([^']+)' (?:has|is set to) the value "([^"]*)"$/ do |source_field, value|
step "the source field '#{source_field}'"
source_name, source_field_name = @brt.sources.parse_full_field(source_field)
- @brt.sources[source_name].fields[source_field_name].value = Remi::BusinessRules::ParseFormula.parse(value)
+ @brt.sources[source_name].fields[source_field_name].value = Remi::Testing::BusinessRules::ParseFormula.parse(value)
end
Given /^the source field (?:has|is set to) the value "([^"]*)"$/ do |value|
@brt.sources.fields.each do |field|
step "the source field '#{field.full_name}' is set to the value \"#{value}\""
@@ -141,11 +141,11 @@
Given /^the source field '([^']+)' (?:has|is set to) the multiline value$/ do |source_field, value|
step "the source field '#{source_field}'"
source_name, source_field_name = @brt.sources.parse_full_field(source_field)
- @brt.sources[source_name].fields[source_field_name].value = Remi::BusinessRules::ParseFormula.parse(value)
+ @brt.sources[source_name].fields[source_field_name].value = Remi::Testing::BusinessRules::ParseFormula.parse(value)
end
Given /^the source field (?:has|is set to) the multiline value$/ do |value|
@brt.sources.fields.each do |field|
step "the source field '#{field.full_name}' has the multiline value #{value}"
@@ -264,10 +264,10 @@
@brt.targets[target_name].add_field(target_field_name)
end
@brt.run_transforms
}.not_to raise_error
Array(target_names).each do |target_name|
- expect(@brt.targets[target_name].fields[target_field_name].values.uniq).to eq [Remi::BusinessRules::ParseFormula.parse(value)]
+ expect(@brt.targets[target_name].fields[target_field_name].values.uniq).to eq [Remi::Testing::BusinessRules::ParseFormula.parse(value)]
end
}
end
Then /^the target field is (?:set to the value|populated with) "([^"]*)"$/ do |value|