spec/daigaku/test_spec.rb in daigaku-0.3.0 vs spec/daigaku/test_spec.rb in daigaku-0.4.0

- old
+ new

@@ -1,9 +1,8 @@ require 'spec_helper' describe Daigaku::Test do - it { is_expected.to respond_to :path } it { is_expected.to respond_to :run } before(:all) do prepare_solutions @@ -13,36 +12,36 @@ let(:unit_path) { all_unit_dirs.first } let(:test_path) { all_test_file_paths.first } subject { Daigaku::Test.new(unit_path) } - it "has the appropriate path" do + it 'has the appropriate path' do expect(subject.path).to eq test_path end - describe "#run" do + describe '#run' do before do - course_name = course_dir_names.first + course_name = course_dir_names.first chapter_name = chapter_dir_names.first - unit_name = unit_dir_names.first + unit_name = unit_dir_names.first + @code = available_solution(course_name, chapter_name, unit_name).code end - it "returns a Daigaku::TestResult" do + it 'returns a Daigaku::TestResult' do expect(subject.run(@code)).to be_a Daigaku::TestResult end - context "when passing" do - it "returns a passing result" do + context 'when passing' do + it 'returns a passing result' do expect(subject.run(@code).passed?).to be_truthy end end - context "when failing" do - it "returns a failing result" do - code = "print 'BYE WORLD'" + context 'when failing' do + it 'returns a failing result' do + code = 'print "BYE WORLD"' expect(subject.run(code).passed?).to be_falsey end end end - end