Repository navigation
Spec
Currect specification , created with rspec.
Tested on:
- x86_64 : JRuby 1.5, Ruby 1.8.7, Ruby 1.9.1
- i686 : Ruby1.9.1
Rserve::Rlist
- method names return correct names
- method == should return true for rlist with equal data and names
- method [] return correct values for strings
- method [] return correct values for integers (0-based)
- method to_a return an array with best ruby representation of data
- method to_ruby returns a named array when all names are set
- method to_ruby returns a simple array when no names are set
- should allow recursive list
Rserve::REXP::Wrapper
- should wrap single value
- should wrap arrays of a single type
- should wrap on a list mixed values
- should wrap arrays with nil values using NA values of specific type
Rserve::RFactor
- method size should return number of ids
- method [] should return correct value (1 based)
- methods contains? should work with integers and strings
- methods count should work with integers and strings
- method counts_hash should return correct value
- method as_integers should return correct values
- method as_strings should return correct values
Rserve::Connection opening and closing
- should be open a connection and receive ID-String
- should raise ServerNotAvailable if started another instance on another port
- should quit correctly
- raise an error if eval is clased after closed
Rserve::Connection basic eval methods
- method eval_void should return true with correct expression
Error: no se pudo encontrar la función “as.stt”
- method eval_void should raise an error with an incorrect expression
- method eval should return a simple object
Error: no se pudo encontrar la función “as.stt”
- method eval should raise an error with an incorrect expression
- should eval_void and eval correctly
- should assign a string
Rserve::Connection assign using REXPs
- should assign double
- should assign a null
- should assign a int vector
- should assign a bool vector
- should assign a string vector
- should assign a list without names
- should assign a list without names and nulls
- should assign a list with names
- should assign a data.frame
- should assign a matrix
Rserve::REXP#to_ruby method to_ruby
- should return a Fixnum with vector with one integer element
- should return an array of Fixnum and nils with vector with two or more elements
- should return an array of Fixnum with an enumeration
- should return an array of String with a factor
- should return an array of String and nils with a factor with NA
- should return a rational with vector with one element
- should return an array of rationals with vector with more than one elements
- should return an object with module WithAttributes included, when attributes are set
- should return a Ruby Matrix with R matrix
- should return a nested array of Ruby Matrixes with vector with more than tree dimensions
- should return a boolean with a logical with one element
- should return an array extended with Rserve::WithNames if vector is named
- should return an array of booleans with a logical with two or more elements
- should return a string with a vector with one string
- should return an array of strings with a vector with two or more strings
- should return an array extended with Rserve::WithNames and Rserve::WithAttributes for a list
Rserve::REXP::Double initialization
- should accept array as payload
- should accept float as payload
Rserve::REXP::Double NA management
- method na? should return coherent answer
- to_a should return correct values with NA
- to_ruby should return correct values with NA
Rserve::REXP::Double common methods
- should return correct length of payload
- should be numeric
- should be integer
- method as_integer should return payload as integers
- method as_doubles should return floats
- method as_strings should return strings
- method to_debug_string and to_s returns a coherent response
Rserve::WithNames
- should return nil without names
Rserve::WithNames with incorrect naming
- should raise an error with names array of another size
- should raise an error with names array !(String or nil)
Rserve::WithNames correct naming
- should set names and return them without problems
- should return correct values with 0-index([x])
- should return correct values with 1-index syntactic sugar (x)
- should return with names([‘x’])
- should push with or without name
- method clear should delete names
- should delete_at names
- should pop names
- should shift names
- should reverse! names
- should slice names
Rserve::Packet
- should be ok if cmd isn’t an error
- should be error if cmd is an error
- method to_s should return coherent to_s
Rserve::Protocol::REXPFactory
- should process null
- should process single logical
- should process array
- should process logical vector
- should process logical vectors with NA
- should process single double
- should process double vector
- should process double vector with NA
- should process string vector
- should process string vector with NA
- should process basic list
- should process list with booleans and NA
- should process data.frame
- should process a nested array
- should retrieve correct lenght for string
- should retrieve correct representation for string
- should retrieve correct binary representation for Symbol
- should retrieve correct binary representation for List
Rserve::Protocol::REXPFactory factor processing
- should process factor without NA
- should process factors with NA
Rserve::REXP with matrix
- method as_integers should return correct values for original vector
- method dim should return correct dimensions
- method as_double_matrix returns a valid double matrix
- method as_matrix returns a valid standard library matrix
- method split_array returns a valid splitted array
Rserve::REXP common methods
- method as_integer should return first value as integer
- method as_double should return first value as float
- method as_string should return first value as string (float representation)
- method has_attribute? should return false for non-lists
- method has_attribute? should return true for existing value
- method has_attribute? should return false for non existing value
- method get_attribute should return correct value for attribute
Rserve::REXP::Integer initialization
- should accept array as payload
- should accept integer as payload
Rserve::REXP::Integer NA management
- method is_NA should return coherent answer
- to_a should return correct values with NA
Rserve::REXP::Integer common methods
- should return correct length of payload
- should be numeric
- should be integer
- method as_integer should return payload
- method as_doubles should return floats
- method as_string should return string
- method to_debug_string and to_s returns a coherent response
Rserve
- should calcule a basic LR without hazzle
Rserve::Protocol
- set_int method should set an integer correctly on an array of bytes
- set_hdr method should set correctly the header for len<0xFFFFFF
- set_hdr method should set correctly the header for len>0xFFFFFF
- new_hdr method should return a correct header for different lengths
- get_int method should return a correct integer for a given buffer
- get_len method should return correct length from a header
- get_long method should return correct long(32 bits) for a given buffer
- set_long method should set correct long(32 bits) for a given buffer
Rserve::REXP::GenericVector initialization
- should accept Rlist as payload and create an attrib called ‘names’
- should accept Rlist and attribs as payload
Rserve::REXP::Integer initialization
- should accept array as payload
- should accept a single value as payload
Rserve::REXP::Integer NA management
- method is_NA should return coherent answer
- method to_a should return correct answer
Rserve::REXP::Integer common methods
- should return correct length of payload
- should be logical
- method as_bytes should return payload
- method as_integer should return integers
- method as_doubles should return floats
- method as_string should return string
- method true? should return an array with true for TRUE values
- method false? should return an array with true for FALSE values
- method to_debug_string and to_s returns a coherent response
Rserve::Talk
- method request_string should return a valid string
- should raise an error on incorrect type of cont
- should behave correctly with cmd as only argument
- should behave correctly with cmd and cont as arguments
Finished in 3.236689361 seconds
155 examples, 0 failures