Skip to content

Commit

Permalink
Enable encoding and fiber specs (1.9)
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed May 23, 2010
1 parent baa11e0 commit 42a0c34
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions spec/jruby.1.9.mspec
Expand Up @@ -68,6 +68,10 @@ class MSpecScript
# Command Line specs
set :command_line, [ SPEC_DIR + '/command_line' ]

# Enable features
MSpec.enable_feature :fiber
MSpec.enable_feature :encoding

if WINDOWS
# Some specs on Windows will fail in we launch JRuby via
# ruby_exe() in-process (see core/argf/gets_spec.rb)
Expand Down
1 change: 1 addition & 0 deletions spec/tags/1.9/ruby/core/array/pack_tags.txt
Expand Up @@ -47,3 +47,4 @@ fails:Array#pack with format 'a' returns result in ASCII-8BIT
fails:Array#pack with format 'Z' treats a multibyte character just as a byte sequence
fails:Array#pack with format 'Z' returns result in ASCII-8BIT
fails:Array#pack with format 'm' ignores star parameter
fails:Array#pack with format 'U' regards a integer as a Unicode codepoint and encodes into UTF-8 byte sequence
2 changes: 1 addition & 1 deletion spec/tags/1.9/ruby/core/encoding/aliases_tags.txt
@@ -1,2 +1,2 @@
fails:Encoding.aliases has an 'external' key with the external default encoding as its value
fails:Encoding.aliases has a 'locale' key with the locale charmap encoding as its value
fails:Encoding.aliases has a 'locale' key and its value equals to the name of the encoding finded by the locale charmap
@@ -1,6 +1,5 @@
fails:Encoding::Converter#replacement returns '?' in US-ASCII when the destination encoding is not UTF-8
fails:Encoding::Converter#replacement returns u{fffd} when the destination encoding is UTF-8
fails:Encoding::Converter#replacement= accepts a String argument
fails:Encoding::Converter#replacement= accepts a String argument of arbitrary length
fails:Encoding::Converter#replacement= raises an TypeError if assigned a non-String argument
fails:Encoding::Converter#replacement= sets #replacement
Expand Down
2 changes: 1 addition & 1 deletion spec/tags/1.9/ruby/core/encoding/locale_charmap_tags.txt
@@ -1 +1 @@
fails:Encoding.locale_charmap returns a value based on the LANG environment variable
fails:Encoding.locale_charmap returns a value based on the LC_ALL environment variable
3 changes: 3 additions & 0 deletions spec/tags/1.9/ruby/core/fiber/resume_tags.txt
Expand Up @@ -11,3 +11,6 @@ critical(hangs):Fiber#resume runs until the end of the block or Fiber.yield on f
critical(hangs):Fiber#resume sets the block parameters to its arguments on the first invocation
critical(hangs):Fiber#resume raises a FiberError if the Fiber has transfered control to another Fiber
fails:Fiber#resume executes the ensure clause
fails:Fiber#resume raises a FiberError if the Fiber is dead
fails:Fiber#resume raises a LocalJumpError if the block includes a return statement
fails:Fiber#resume raises a LocalJumpError if the block includes a break statement
2 changes: 2 additions & 0 deletions spec/tags/1.9/ruby/core/string/bytes_tags.txt
@@ -0,0 +1,2 @@
fails:String#bytes agrees with #getbyte
fails:String#bytes is unaffected by #force_encoding
1 change: 1 addition & 0 deletions spec/tags/1.9/ruby/core/string/clear_tags.txt
@@ -1,2 +1,3 @@
critical(crashes when executed along with ascii_only_spec.rb):String#clear preserves its encoding
fails:String#clear raises a RuntimeError if self is frozen
fails:String#clear preserves its encoding
8 changes: 8 additions & 0 deletions spec/tags/1.9/ruby/core/string/encode_tags.txt
Expand Up @@ -8,3 +8,11 @@ fails:String#encode replaces xml characters and quotes the result
fails:String#encode returns a copy of self when called with only a target encoding
fails:String#encode returns self when called with only a target encoding
fails:String#encode returns a String with the given encoding
fails:String#encode! transcodes to the default internal encoding with no argument
fails:String#encode! transcodes self to the given encoding
fails:String#encode! raises UndefinedConversionError if the String contains characters invalid for the target encoding
fails:String#encode! replaces invalid characters
fails:String#encode! replaces undefined characters
fails:String#encode! replaces xml characters
fails:String#encode! replaces xml characters and quotes the result
fails:String#encode! tags the String with the given encoding
7 changes: 7 additions & 0 deletions src/org/jruby/RubyConverter.java
Expand Up @@ -26,8 +26,10 @@
package org.jruby;

import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyMethod;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;

@JRubyClass(name="Converter")
Expand Down Expand Up @@ -62,4 +64,9 @@ public RubyConverter(Ruby runtime, RubyClass klass) {
public RubyConverter(Ruby runtime) {
super(runtime, runtime.getConverter());
}

@JRubyMethod(name = "convpath", compat = CompatVersion.RUBY1_9)
public IRubyObject convpath(ThreadContext context) {
return context.getRuntime().getNil();
}
}

0 comments on commit 42a0c34

Please sign in to comment.