ideone 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ideone.rb +1 -2
- data/test/basic.rb +7 -1
- metadata +3 -3
data/lib/ideone.rb
CHANGED
@@ -2,7 +2,6 @@ require 'json'
|
|
2
2
|
require 'net/http'
|
3
3
|
require 'cgi'
|
4
4
|
|
5
|
-
|
6
5
|
module Ideone
|
7
6
|
|
8
7
|
class IdeoneError < StandardError; end
|
@@ -98,7 +97,7 @@ module Ideone
|
|
98
97
|
else
|
99
98
|
out = res['inouterr'].match(/<label>output:<\/label>.*?<pre.*?>(.*?)<\/pre>/m)
|
100
99
|
if out
|
101
|
-
out[1]
|
100
|
+
CGI.unescape_html out[1]
|
102
101
|
end
|
103
102
|
end
|
104
103
|
end
|
data/test/basic.rb
CHANGED
@@ -35,6 +35,12 @@ describe 'an ideone gem user' do
|
|
35
35
|
it "can submit Ruby code that doesn't print anything to stdout" do
|
36
36
|
paste_id = Ideone.submit( :ruby, %{1+1} )
|
37
37
|
results = Ideone.run( paste_id, nil )
|
38
|
-
results.should.
|
38
|
+
results.should.be.nil
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'can submit Ruby code and receive stdout that has characters that would get HTML escaped' do
|
42
|
+
paste_id = Ideone.submit( :ruby, %{p '1 < 2'} )
|
43
|
+
results = Ideone.run( paste_id, nil )
|
44
|
+
results.should.equal %{"1 < 2"\n}
|
39
45
|
end
|
40
46
|
end
|
metadata
CHANGED