Skip to content
This repository
Browse code

Fixed some specs for 1.9 and removed mspec excludes.

  • Loading branch information...
commit 488053c60ef5513531d50556e534f544a3e93eb8 1 parent 1126450
Brian Shirai brixen authored
2  spec/core/bytearray/element_set_spec.rb
@@ -9,7 +9,7 @@
9 9 it "sets the byte at index" do
10 10 str = "01234"
11 11 b = ByteArraySpecs.new_bytearray str
12   - (0...str.size).each { |i| b[i] = b[i] + ?A }
  12 + (0...str.size).each { |i| b[i] = b[i] + 65 }
13 13
14 14 "qrstu".each_byte.with_index { |x, i| b[i].should == x }
15 15 end
2  spec/core/chararray/element_set_spec.rb
@@ -4,7 +4,7 @@
4 4 it "sets the byte at index" do
5 5 s = "01234"
6 6 b = s.data
7   - 0.upto(s.size-1) { |i| b[i] = b[i] + ?A }
  7 + 0.upto(s.size-1) { |i| b[i] = b[i] + 65 }
8 8 s.should == "qrstu"
9 9 end
10 10 end
9 spec/core/ctype/toprint_spec.rb
@@ -3,7 +3,8 @@
3 3 describe "CType#toprint" do
4 4 it "returns escaped control characters" do
5 5 a = []
6   - [?\n, ?\t, ?\a, ?\v, ?\f, ?\r, ?\e, ?\b].each do |c|
  6 + # ?\n, ?\t, ?\a, ?\v, ?\f, ?\r, ?\e, ?\b
  7 + [10, 9, 7, 11, 12, 13, 27, 8].each do |c|
7 8 a << Rubinius::CType.toprint(c)
8 9 end
9 10
@@ -11,16 +12,16 @@
11 12 end
12 13
13 14 it "returns '\\\"' for '?\"'" do
14   - Rubinius::CType.toprint(?").should == "\\\""
  15 + Rubinius::CType.toprint(34).should == "\\\""
15 16 end
16 17
17 18 it "returns '\\\\' for '?\\'" do
18   - Rubinius::CType.toprint(?\\).should == "\\\\"
  19 + Rubinius::CType.toprint(92).should == "\\\\"
19 20 end
20 21
21 22 it "returns a table of transforms for '?#'" do
22 23 table = Rubinius::Tuple['#$', '\#$', '#@', '\#@', '#{', '\#{', '#', '#']
23   - Rubinius::CType.toprint(?#).to_a.should == table.to_a
  24 + Rubinius::CType.toprint(35).to_a.should == table.to_a
24 25 end
25 26
26 27 it "returns an octal value for values 0..31 except for control characters" do
30 spec/library/config/rbconfig_spec.rb
@@ -123,17 +123,29 @@ def it_has_entries(name, entries)
123 123
124 124 describe "RbConfig#ruby" do
125 125
126   - RbConfig.respond_to?(:ruby).should eql(true)
  126 + ruby_version_is "1.8" do
  127 + before :each do
  128 + @version_switch = "-X18"
  129 + end
  130 + end
  131 +
  132 + ruby_version_is "1.9" do
  133 + before :each do
  134 + @version_switch = "-X19"
  135 + end
  136 + end
127 137
128   - rb_path = RbConfig.ruby
129   - rb_path.should be_kind_of(String)
  138 + it "returns the path to the running Ruby executable" do
  139 + rb_path = RbConfig.ruby
  140 + rb_path.should be_kind_of(String)
130 141
131   - # needs to be an executable
132   - File.executable?(rb_path).should eql(true)
  142 + # needs to be an executable
  143 + File.executable?(rb_path).should eql(true)
133 144
134   - # make sure the executable it points to has the same RbConfig we have
135   - cmd = "#{rb_path} -rrbconfig -e 'puts Marshal.dump(RbConfig::CONFIG)'"
136   - rb_config = Marshal.load(`#{cmd}`)
  145 + # make sure the executable it points to has the same RbConfig we have
  146 + cmd = "#{rb_path} #{@version_switch} -rrbconfig -e 'puts Marshal.dump(RbConfig::CONFIG)'"
  147 + rb_config = Marshal.load(`#{cmd}`)
137 148
138   - rb_config.should eql(RbConfig::CONFIG)
  149 + rb_config.should == RbConfig::CONFIG
  150 + end
139 151 end
22 spec/rbx.1.9.mspec
@@ -104,27 +104,14 @@ class MSpecScript
104 104 'spec/build',
105 105
106 106 # Excluded while building out basic 1.9 infrastructure
107   - '^spec/ruby/core/basicobject/basic_object_class',
108   - '^spec/ruby/core/basicobject/metaclass',
109 107 '^spec/ruby/core/encoding/default_internal',
110 108 '^spec/ruby/core/io/open',
111   - '^spec/ruby/core/kernel/define_singleton_method',
112   - '^spec/ruby/core/method/parameters',
113 109 '^spec/ruby/core/module/name',
114 110 '^spec/ruby/core/numeric/to_c',
115 111 '^spec/ruby/core/proc/arity',
116   - '^spec/ruby/core/proc/parameters',
117 112 '^spec/ruby/core/process/spawn',
118 113 '^spec/ruby/core/process/status',
119 114 '^spec/ruby/core/string/getbyte',
120   - '^spec/ruby/language/array',
121   - '^spec/ruby/language/case',
122   - '^spec/ruby/language/literal_lambda',
123   - '^spec/ruby/language/method',
124   - '^spec/ruby/language/super',
125   - '^spec/ruby/language/symbol',
126   - '^spec/ruby/language/variables',
127   - '^spec/ruby/command_line/dash_e',
128 115
129 116 '^spec/ruby/library/abbrev',
130 117 '^spec/ruby/library/cgi',
@@ -152,15 +139,6 @@ class MSpecScript
152 139 '^spec/ruby/optional/capi/io',
153 140 '^spec/ruby/optional/capi/time',
154 141
155   - '^spec/core/bytearray/element_set',
156   - '^spec/core/chararray',
157   - '^spec/core/ctype',
158   - '^spec/library/config/rbconfig',
159   -
160   - '^spec/compiler/attrasgn',
161   - '^spec/compiler/ensure',
162   - '^spec/compiler/masgn',
163   -
164 142 # Excluded because the specs are extremely system dependent.
165 143 '^spec/ruby/library/syslog',
166 144
1  spec/tags/19/compiler/attrasgn_tags.txt
... ... @@ -0,0 +1 @@
  1 +fails:An Attrasgn node is compiled from 'a[b, *c] = *d'
1  spec/tags/19/compiler/ensure_tags.txt
... ... @@ -0,0 +1 @@
  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"
5 spec/tags/19/compiler/masgn_tags.txt
... ... @@ -0,0 +1,5 @@
  1 +fails:A Masgn node is compiled from '*a.m = b'
  2 +fails:A Masgn node is compiled from '*$a = b'
  3 +fails:A Masgn node is compiled from '*@a = b'
  4 +fails:A Masgn node is compiled from '*a = b'
  5 +fails:A Masgn node is compiled from '*a = lambda { a = 8 }'
2  spec/tags/19/ruby/command_line/dash_e_tags.txt
... ... @@ -0,0 +1,2 @@
  1 +fails:The -e command line option with -n and a Fixnum range mimics an awk conditional by comparing an inclusive-end range with $.
  2 +fails:The -e command line option with -n and a Fixnum range mimics a sed conditional by comparing an exclusive-end range with $.
1  spec/tags/19/ruby/core/kernel/define_singleton_method_tags.txt
... ... @@ -1 +1,2 @@
1 1 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
  2 +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.
Something went wrong with that request. Please try again.