Browse files

Fixed some specs for 1.9 and removed mspec excludes.

  • Loading branch information...
1 parent 1126450 commit 488053c60ef5513531d50556e534f544a3e93eb8 Brian Ford committed Sep 12, 2011
View
2 spec/core/bytearray/element_set_spec.rb
@@ -9,7 +9,7 @@
it "sets the byte at index" do
str = "01234"
b = ByteArraySpecs.new_bytearray str
- (0...str.size).each { |i| b[i] = b[i] + ?A }
+ (0...str.size).each { |i| b[i] = b[i] + 65 }
"qrstu".each_byte.with_index { |x, i| b[i].should == x }
end
View
2 spec/core/chararray/element_set_spec.rb
@@ -4,7 +4,7 @@
it "sets the byte at index" do
s = "01234"
b = s.data
- 0.upto(s.size-1) { |i| b[i] = b[i] + ?A }
+ 0.upto(s.size-1) { |i| b[i] = b[i] + 65 }
s.should == "qrstu"
end
end
View
9 spec/core/ctype/toprint_spec.rb
@@ -3,24 +3,25 @@
describe "CType#toprint" do
it "returns escaped control characters" do
a = []
- [?\n, ?\t, ?\a, ?\v, ?\f, ?\r, ?\e, ?\b].each do |c|
+ # ?\n, ?\t, ?\a, ?\v, ?\f, ?\r, ?\e, ?\b
+ [10, 9, 7, 11, 12, 13, 27, 8].each do |c|
a << Rubinius::CType.toprint(c)
end
a.should == ["\\n", "\\t", "\\a", "\\v", "\\f", "\\r", "\\e", "\\b"]
end
it "returns '\\\"' for '?\"'" do
- Rubinius::CType.toprint(?").should == "\\\""
+ Rubinius::CType.toprint(34).should == "\\\""
end
it "returns '\\\\' for '?\\'" do
- Rubinius::CType.toprint(?\\).should == "\\\\"
+ Rubinius::CType.toprint(92).should == "\\\\"
end
it "returns a table of transforms for '?#'" do
table = Rubinius::Tuple['#$', '\#$', '#@', '\#@', '#{', '\#{', '#', '#']
- Rubinius::CType.toprint(?#).to_a.should == table.to_a
+ Rubinius::CType.toprint(35).to_a.should == table.to_a
end
it "returns an octal value for values 0..31 except for control characters" do
View
30 spec/library/config/rbconfig_spec.rb
@@ -123,17 +123,29 @@ def it_has_entries(name, entries)
describe "RbConfig#ruby" do
- RbConfig.respond_to?(:ruby).should eql(true)
+ ruby_version_is "1.8" do
+ before :each do
+ @version_switch = "-X18"
+ end
+ end
+
+ ruby_version_is "1.9" do
+ before :each do
+ @version_switch = "-X19"
+ end
+ end
- rb_path = RbConfig.ruby
- rb_path.should be_kind_of(String)
+ it "returns the path to the running Ruby executable" do
+ rb_path = RbConfig.ruby
+ rb_path.should be_kind_of(String)
- # needs to be an executable
- File.executable?(rb_path).should eql(true)
+ # needs to be an executable
+ File.executable?(rb_path).should eql(true)
- # make sure the executable it points to has the same RbConfig we have
- cmd = "#{rb_path} -rrbconfig -e 'puts Marshal.dump(RbConfig::CONFIG)'"
- rb_config = Marshal.load(`#{cmd}`)
+ # make sure the executable it points to has the same RbConfig we have
+ cmd = "#{rb_path} #{@version_switch} -rrbconfig -e 'puts Marshal.dump(RbConfig::CONFIG)'"
+ rb_config = Marshal.load(`#{cmd}`)
- rb_config.should eql(RbConfig::CONFIG)
+ rb_config.should == RbConfig::CONFIG
+ end
end
View
22 spec/rbx.1.9.mspec
@@ -104,27 +104,14 @@ class MSpecScript
'spec/build',
# Excluded while building out basic 1.9 infrastructure
- '^spec/ruby/core/basicobject/basic_object_class',
- '^spec/ruby/core/basicobject/metaclass',
'^spec/ruby/core/encoding/default_internal',
'^spec/ruby/core/io/open',
- '^spec/ruby/core/kernel/define_singleton_method',
- '^spec/ruby/core/method/parameters',
'^spec/ruby/core/module/name',
'^spec/ruby/core/numeric/to_c',
'^spec/ruby/core/proc/arity',
- '^spec/ruby/core/proc/parameters',
'^spec/ruby/core/process/spawn',
'^spec/ruby/core/process/status',
'^spec/ruby/core/string/getbyte',
- '^spec/ruby/language/array',
- '^spec/ruby/language/case',
- '^spec/ruby/language/literal_lambda',
- '^spec/ruby/language/method',
- '^spec/ruby/language/super',
- '^spec/ruby/language/symbol',
- '^spec/ruby/language/variables',
- '^spec/ruby/command_line/dash_e',
'^spec/ruby/library/abbrev',
'^spec/ruby/library/cgi',
@@ -152,15 +139,6 @@ class MSpecScript
'^spec/ruby/optional/capi/io',
'^spec/ruby/optional/capi/time',
- '^spec/core/bytearray/element_set',
- '^spec/core/chararray',
- '^spec/core/ctype',
- '^spec/library/config/rbconfig',
-
- '^spec/compiler/attrasgn',
- '^spec/compiler/ensure',
- '^spec/compiler/masgn',
-
# Excluded because the specs are extremely system dependent.
'^spec/ruby/library/syslog',
View
1 spec/tags/19/compiler/attrasgn_tags.txt
@@ -0,0 +1 @@
+fails:An Attrasgn node is compiled from 'a[b, *c] = *d'
View
1 spec/tags/19/compiler/ensure_tags.txt
@@ -0,0 +1 @@
+fails:"An Ensure node is compiled from \n begin\n # do nothing\n rescue\n # do nothing\n ensure\n # do nothing\n end"
View
5 spec/tags/19/compiler/masgn_tags.txt
@@ -0,0 +1,5 @@
+fails:A Masgn node is compiled from '*a.m = b'
+fails:A Masgn node is compiled from '*$a = b'
+fails:A Masgn node is compiled from '*@a = b'
+fails:A Masgn node is compiled from '*a = b'
+fails:A Masgn node is compiled from '*a = lambda { a = 8 }'
View
2 spec/tags/19/ruby/command_line/dash_e_tags.txt
@@ -0,0 +1,2 @@
+fails:The -e command line option with -n and a Fixnum range mimics an awk conditional by comparing an inclusive-end range with $.
+fails:The -e command line option with -n and a Fixnum range mimics a sed conditional by comparing an exclusive-end range with $.
View
1 spec/tags/19/ruby/core/kernel/define_singleton_method_tags.txt
@@ -1 +1,2 @@
fails:Kernel#define_singleton_method when given an UnboundMethod will raise when attempting to define an object's singleton method from another objetc's singleton method
+fails:Kernel#define_singleton_method when given an UnboundMethod will raise when attempting to define an object's singleton method from another object's singleton method

0 comments on commit 488053c

Please sign in to comment.