transferred Code Ocean from original repository to GitHub

This commit is contained in:
Hauke Klement
2015-01-22 09:51:49 +01:00
commit 4cbf9970b1
683 changed files with 11979 additions and 0 deletions

25
spec/lib/assessor_spec.rb Normal file
View File

@ -0,0 +1,25 @@
require 'rails_helper'
describe Assessor do
describe '#calculate_score' do
let(:count) { 42 }
let(:passed) { 17 }
let(:test_outcome) { {count: count, passed: passed} }
context 'with a testing framework adapter' do
let(:assessor) { Assessor.new(execution_environment: FactoryGirl.build(:ruby)) }
it 'returns the correct score' do
expect(assessor.send(:calculate_score, test_outcome)).to eq(passed.to_f / count.to_f)
end
end
context 'without a testing framework adapter' do
let(:assessor) { Assessor.new(execution_environment: FactoryGirl.build(:execution_environment)) }
it 'raises an error' do
expect { assessor.send(:calculate_score, test_outcome) }.to raise_error
end
end
end
end