Migrated to proforma 0.6

Fixed all failing specs
This commit is contained in:
Karol
2021-05-24 14:58:36 +02:00
parent aabb6ca6bc
commit 8a7eae1a56
10 changed files with 39 additions and 29 deletions

View File

@ -161,7 +161,8 @@ RSpec.describe ProformaService::ConvertExerciseToTask do
id: test_file.id,
title: test_file.name,
files: have(1).item,
meta_data: {'feedback-message' => test_file.feedback_message}
meta_data: [{key: 'entry-point', namespace: 'openHPI', value: test_file.filepath},
{key: 'feedback-message', namespace: 'openHPI', value: 'feedback_message'}]
)
end

View File

@ -229,11 +229,11 @@ describe ProformaService::ConvertTaskToExercise do
internal_description: 'internal_description',
test_type: 'test_type',
files: test_files,
meta_data: {
'feedback-message' => 'feedback-message',
'testing-framework' => 'testing-framework',
'testing-framework-version' => 'testing-framework-version',
}
meta_data: [
{namespace: 'openHPI', key: 'feedback-message', value: 'feedback-message'},
{namespace: 'openHPI', key: 'testing-framework', value: 'testing-framework'},
{namespace: 'openHPI', key: 'testing-framework-version', value: 'testing-framework-version'},
]
)
end
@ -272,11 +272,11 @@ describe ProformaService::ConvertTaskToExercise do
let(:test2) do
Proforma::Test.new(
files: test_files2,
meta_data: {
'feedback-message' => 'feedback-message',
'testing-framework' => 'testing-framework',
'testing-framework-version' => 'testing-framework-version',
}
meta_data: [
{namespace: 'openHPI', key: 'feedback-message', value: 'feedback-message'},
{namespace: 'openHPI', key: 'testing-framework', value: 'testing-framework'},
{namespace: 'openHPI', key: 'testing-framework-version', value: 'testing-framework-version'},
]
)
end
let(:test_files2) { [test_file2] }
@ -352,11 +352,11 @@ describe ProformaService::ConvertTaskToExercise do
internal_description: 'regular_file',
test_type: 'test_type',
files: test_files,
meta_data: {
'feedback-message' => 'feedback-message',
'testing-framework' => 'testing-framework',
'testing-framework-version' => 'testing-framework-version',
}
meta_data: [
{namespace: 'openHPI', key: 'feedback-message', value: 'feedback-message'},
{namespace: 'openHPI', key: 'testing-framework', value: 'testing-framework'},
{namespace: 'openHPI', key: 'testing-framework-version', value: 'testing-framework-version'},
]
)
end
let(:test_files) { [test_file] }

View File

@ -30,7 +30,7 @@ describe ProformaService::ExportTask do
before do
allow(ProformaService::ConvertExerciseToTask).to receive(:call).with(exercise: exercise).and_return(task)
allow(Proforma::Exporter).to receive(:new).with(task).and_return(exporter)
allow(Proforma::Exporter).to receive(:new).with(task: task, custom_namespaces: [{prefix: 'openHPI', uri: 'open.hpi.de'}]).and_return(exporter)
end
it do

View File

@ -31,7 +31,11 @@ RSpec::Matchers.define :be_an_equal_exercise_as do |exercise|
return true if object == other # for []
return false if object.length != other.length
object.to_a.product(other.to_a).map {|k, v| equal?(k, v) }.any?
object.map do |element|
other.map {|other_element| equal?(element, other_element) }.any?
end.all? && other.map do |element|
object.map {|other_element| equal?(element, other_element) }.any?
end.all?
end
def attributes_and_associations(object)