Skip to content

Commit

Permalink
Merge pull request #211 from outdooricon/mocha_2.3.0
Browse files Browse the repository at this point in the history
Upgrade to Mocha 2.3.0
  • Loading branch information
jfirebaugh committed Sep 2, 2015
2 parents d4636e7 + ed61e53 commit a44f0b5
Show file tree
Hide file tree
Showing 7 changed files with 9,888 additions and 2,270 deletions.
6 changes: 5 additions & 1 deletion app/assets/javascripts/konacha/parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ window.onload = function () {
currentSuite = suite;

while (!(specFilePath = currentSuite.path)) {
currentSuite = currentSuite.parent
if (currentSuite.parent) {
currentSuite = currentSuite.parent;
} else {
break;
}
}

specFilePath = /([^\.]*)/.exec(specFilePath)[1];
Expand Down
2 changes: 1 addition & 1 deletion mocha
Submodule mocha updated 169 files
6 changes: 0 additions & 6 deletions spec/dummy/spec/javascripts/failing_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ describe("failure", function(){
(2 + 2).should.equal(5);
});

it("errors", function() {
// Mocha catches and re-throws string exceptions, so we only need to test
// throwing real Error objects.
throw new Error("this one errors out");
});

it("errors asynchronously", function(done) {
setTimeout(function() {
(2 + 2).should.equal(5);
Expand Down
4 changes: 2 additions & 2 deletions spec/mocha_links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
subject{ page.find_link('A test suite') }

it 'should contain spec path and grep string' do
subject['href'].should == "#{page.current_url}#{spec_file}?grep=#{URI.encode(suite_name)}"
subject['href'].should == "#{page.current_url}#{spec_file}/?grep=#{URI.encode(suite_name)}"
end
end

describe 'replay link (arrow icon)' do
subject{ page.find(%Q{a[href="#{page.current_url}#{spec_file}?grep=#{URI.encode([suite_name, test_name].join(' '))}"]}) }
subject{ page.find(%Q{a[href="#{page.current_url}#{spec_file}/?grep=#{URI.encode([suite_name, test_name].join(' '))}"]}) }

it 'should contain spec path and grep string' do
subject.should_not be_nil
Expand Down
14 changes: 1 addition & 13 deletions spec/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
{'event' => 'fail',
'type' => 'test',
'data' => {
'duration' => anything,
'title' => 'fails',
'fullTitle' => 'failure fails',
'parentFullTitle' => 'failure',
Expand All @@ -77,18 +78,6 @@
'error' => {'message' => 'expected 4 to equal 5', 'name' => 'AssertionError'}}}
end

let(:error) do
{'event' => 'fail',
'type' => 'test',
'data' => {
'title' => 'errors',
'fullTitle' => 'failure errors',
'parentFullTitle' => 'failure',
'status' => 'failed',
'path' => 'failing_spec.js',
'error' => {'message' => 'this one errors out', 'name' => 'Error'}}}
end

let(:error_async) do
{'event' => 'fail',
'type' => 'test',
Expand Down Expand Up @@ -135,7 +124,6 @@
subject.reporter.should_receive(:process_mocha_event).with(suite_end)
subject.reporter.should_receive(:process_mocha_event).with(test)
subject.reporter.should_receive(:process_mocha_event).with(failure)
subject.reporter.should_receive(:process_mocha_event).with(error)
subject.reporter.should_receive(:process_mocha_event).with(error_async)
subject.reporter.should_receive(:process_mocha_event).with(pass)
subject.reporter.should_receive(:process_mocha_event).with(pending)
Expand Down
Loading

0 comments on commit a44f0b5

Please sign in to comment.