File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ install:
1717 - docker pull codingblocks/judge-worker-py3
1818 - docker pull codingblocks/judge-worker-nodejs6
1919 - docker pull codingblocks/judge-worker-nodejs8
20+ - docker pull codingblocks/judge-worker-ruby
2021
2122script :
2223 - npm run cover
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ exports = module.exports = {
4343 SOURCE_FILE : 'script.js' ,
4444 CPU_SHARE : "0.8" ,
4545 MEM_LIMIT : '300m'
46+ } ,
47+ 'ruby' : {
48+ SOURCE_FILE : 'script.rb' ,
49+ CPU_SHARE : "0.8" ,
50+ MEM_LIMIT : '300m'
4651 }
4752 }
4853}
Original file line number Diff line number Diff line change 1+ import { execRun } from '../src/tasks/run'
2+ import { expect } from 'chai'
3+
4+
5+ describe ( 'run - ruby' , ( ) => {
6+ it ( '.rb file runs correctly' , ( ) => {
7+ execRun ( {
8+ id : 27 ,
9+ lang : 'ruby' ,
10+ source : ( new Buffer ( `
11+ puts "Hello " + gets.to_s
12+ ` ) ) . toString ( 'base64' ) ,
13+ stdin : ( new Buffer ( 'World' ) ) . toString ( 'base64' )
14+ } , ( runResult ) => {
15+ expect ( new Buffer ( runResult . stdout , 'base64' ) . toString ( 'ascii' ) ) . to . eq ( 'Hello World\n' )
16+ } )
17+ } )
18+ } )
You can’t perform that action at this time.
0 commit comments