Skip to content

Commit 97824ec

Browse files
committed
Pulled from rfc2616. Working on spec on windows
1 parent d50b5a3 commit 97824ec

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pkg
22
doc
3+
*~

lib/rinruby.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def initialize(*args)
189189
def quit
190190
begin
191191
@writer.puts "q(save='no')"
192+
# TODO: Verify if read is needed
192193
@socket.read()
193194
#@socket.close
194195
@engine.close

spec/rinruby_spec.rb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44
describe RinRuby do
55
describe "on init" do
66
it "should accept parameters as specified on Dahl & Crawford(2009)" do
7+
8+
platform = case RUBY_PLATFORM
9+
when /mswin/ then 'windows'
10+
when /mingw/ then 'windows'
11+
when /bccwin/ then 'windows'
12+
else
13+
"other"
14+
end
15+
if platform=='windows'
16+
pending("Difficult to test without specific location of R executable on Windows")
17+
else
18+
719
r=RinRuby.new(false, false, "R", 38500, 1)
820
r.echo_enabled.should_not be_true
921
r.interactive.should_not be_true
10-
r.executable.should=='R'
22+
r.executable.should=="R"
1123
r.port_number.should==38500
12-
r.port_width.should==1
13-
14-
24+
r.port_width.should==1
25+
end
1526
end
1627
it "should accept :echo and :interactive parameters" do
1728
r=RinRuby.new(:echo=>false, :interactive=>false)
@@ -113,7 +124,7 @@
113124
rx=R.x
114125
matrix.row_size.times {|i|
115126
matrix.column_size.times {|j|
116-
matrix[i,j].should be_close(rx[i,j],1e-10)
127+
matrix[i,j].should be_within(1e-10).of(rx[i,j])
117128
}
118129
}
119130
end

spec/spec_helper.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
$LOAD_PATH.unshift(File.dirname(__FILE__))
2-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
1+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
2+
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')))
33
require 'rinruby'
4-
require 'spec'
5-
require 'spec/autorun'
4+
require 'rspec'
65

76
require 'matrix'
87

0 commit comments

Comments
 (0)