Skip to content

Commit

Permalink
Add RSpec support
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmccurdy committed Apr 19, 2015
1 parent 84dea01 commit fe8105a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions formatters.json
Expand Up @@ -3,5 +3,10 @@
"suite": "describe('%s', function () {",
"test": "it('%s');",
"end": "});"
},
"rspec": {
"suite": "describe '%s' do",
"test": "it '%s'",
"end": "end"
}
}
File renamed without changes.
5 changes: 5 additions & 0 deletions test/data/rspec_output.rb
@@ -0,0 +1,5 @@
describe 'Array' do
describe '#indexOf()' do
it 'should return -1 when the value is not present'
end
end
15 changes: 12 additions & 3 deletions test/index.js
Expand Up @@ -9,13 +9,22 @@ describe('Procrastinate', function () {
});
});

var fileOptions = { encoding: 'utf-8' };
var input = fs.readFileSync('test/data/input.txt', fileOptions);

context('with an input representing pending Mocha specs', function () {
var fileOptions = { encoding: 'utf-8' };
var input = fs.readFileSync('test/data/input.txt', fileOptions);
var output = fs.readFileSync('test/data/output.js', fileOptions);
var output = fs.readFileSync('test/data/mocha_output.js', fileOptions);

it('returns pending Mocha specs', function () {
assert.equal(procrastinate('mocha', input), output);
});
});

context('with an input representing pending RSpec specs', function () {
var output = fs.readFileSync('test/data/rspec_output.rb', fileOptions);

it('returns pending RSpec specs', function () {
assert.equal(procrastinate('rspec', input), output);
});
});
});

0 comments on commit fe8105a

Please sign in to comment.