Sha256: b1f2e11a76b27a9358a959220fd62e14a5ceed1af7aceae410008dd5c30b60d0
Contents?: true
Size: 1.39 KB
Versions: 13
Compression:
Stored size: 1.39 KB
Contents
require 'spec_helper' describe Solution do describe '#run_tests!' do let(:user) { create(:user) } before { expect_any_instance_of(Challenge).to receive(:automated_evaluation_class).and_return(Mumuki::Laboratory::Evaluation::Automated) } before { expect_any_instance_of(Language).to receive(:run_tests!).and_return(bridge_response) } context 'when results have no expectation' do let(:exercise) { create(:x_equal_5_exercise) } let(:assignment) { exercise.submit_solution! user } let(:bridge_response) { {result: '0 failures', status: :passed} } it { expect(assignment.status).to eq(:passed) } it { expect(assignment.result).to include('0 failures') } end context 'when results have expectations' do let(:exercise_with_expectations) { create(:x_equal_5_exercise, expectations: [{binding: :foo, inspection: :HasComposition}]) } let(:assignment) { exercise_with_expectations.submit_solution! user } let(:bridge_response) { { result: '0 failures', status: :passed, expectation_results: [binding: 'foo', inspection: 'HasBinding', result: :passed]} } it { expect(assignment.status).to eq(:passed) } it { expect(assignment.result).to include('0 failures') } it { expect(assignment.expectation_results).to eq([{binding: 'foo', inspection: 'HasBinding', result: :passed}]) } end end end
Version data entries
13 entries across 13 versions & 1 rubygems