diff options
Diffstat (limited to 'spec/ruby/fixtures')
| -rw-r--r-- | spec/ruby/fixtures/code/concurrent_require_fixture.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/fixtures/code/d/load_fixture.rb.rb | 1 | ||||
| -rw-r--r-- | spec/ruby/fixtures/constants.rb | 5 | ||||
| -rw-r--r-- | spec/ruby/fixtures/enumerator/classes.rb | 15 | ||||
| -rw-r--r-- | spec/ruby/fixtures/io.rb | 12 | ||||
| -rw-r--r-- | spec/ruby/fixtures/math/common.rb | 3 | ||||
| -rw-r--r-- | spec/ruby/fixtures/rational.rb | 14 |
7 files changed, 20 insertions, 34 deletions
diff --git a/spec/ruby/fixtures/code/concurrent_require_fixture.rb b/spec/ruby/fixtures/code/concurrent_require_fixture.rb new file mode 100644 index 0000000000..d4ce734183 --- /dev/null +++ b/spec/ruby/fixtures/code/concurrent_require_fixture.rb @@ -0,0 +1,4 @@ +object = ScratchPad.recorded +thread = Thread.new { object.require(__FILE__) } +Thread.pass until thread.stop? +ScratchPad.record(thread) diff --git a/spec/ruby/fixtures/code/d/load_fixture.rb.rb b/spec/ruby/fixtures/code/d/load_fixture.rb.rb new file mode 100644 index 0000000000..7e9217729a --- /dev/null +++ b/spec/ruby/fixtures/code/d/load_fixture.rb.rb @@ -0,0 +1 @@ +ScratchPad << :rbrb diff --git a/spec/ruby/fixtures/constants.rb b/spec/ruby/fixtures/constants.rb index 47a8e87e56..7f0b88daab 100644 --- a/spec/ruby/fixtures/constants.rb +++ b/spec/ruby/fixtures/constants.rb @@ -10,7 +10,7 @@ # variety in class and module configurations, including hierarchy, # containment, inclusion, singletons and toplevel. # -# Constants are numbered for for uniqueness. The CS_ prefix is uniformly used +# Constants are numbered for uniqueness. The CS_ prefix is uniformly used # and is to minimize clashes with other toplevel constants (see e.g. ModuleA # which is included in Object). Constant values are symbols. A numbered suffix # is used to distinguish constants with the same name defined in different @@ -44,6 +44,7 @@ module ConstantSpecs # Included in ParentA module ModuleB + LINE = __LINE__ - 1 CS_CONST10 = :const10_9 CS_CONST11 = :const11_2 CS_CONST12 = :const12_1 @@ -87,7 +88,7 @@ module ConstantSpecs # are run. class ClassA - CS_CLASS_A_LINE = __LINE__ - 1 + LINE = __LINE__ - 1 CS_CONST10 = :const10_10 CS_CONST10_LINE = __LINE__ - 1 CS_CONST16 = :const16 diff --git a/spec/ruby/fixtures/enumerator/classes.rb b/spec/ruby/fixtures/enumerator/classes.rb deleted file mode 100644 index 6f285b8efa..0000000000 --- a/spec/ruby/fixtures/enumerator/classes.rb +++ /dev/null @@ -1,15 +0,0 @@ -module EnumSpecs - class Numerous - - include Enumerable - - def initialize(*list) - @list = list.empty? ? [2, 5, 3, 6, 1, 4] : list - end - - def each - @list.each { |i| yield i } - end - end - -end diff --git a/spec/ruby/fixtures/io.rb b/spec/ruby/fixtures/io.rb new file mode 100644 index 0000000000..87ebbbb2bd --- /dev/null +++ b/spec/ruby/fixtures/io.rb @@ -0,0 +1,12 @@ +module IOSpec + def self.exhaust_write_buffer(io) + written = 0 + buf = " " * 4096 + + while true + written += io.write_nonblock(buf) + end + rescue Errno::EAGAIN, Errno::EWOULDBLOCK + written + end +end diff --git a/spec/ruby/fixtures/math/common.rb b/spec/ruby/fixtures/math/common.rb deleted file mode 100644 index 024732fa7a..0000000000 --- a/spec/ruby/fixtures/math/common.rb +++ /dev/null @@ -1,3 +0,0 @@ -class IncludesMath - include Math -end diff --git a/spec/ruby/fixtures/rational.rb b/spec/ruby/fixtures/rational.rb deleted file mode 100644 index 844d7f9820..0000000000 --- a/spec/ruby/fixtures/rational.rb +++ /dev/null @@ -1,14 +0,0 @@ -module RationalSpecs - class SubNumeric < Numeric - def initialize(value) - @value = Rational(value) - end - - def to_r - @value - end - end - - class CoerceError < StandardError - end -end |
