diff options
Diffstat (limited to 'spec/ruby/core/float/fixtures')
| -rw-r--r-- | spec/ruby/core/float/fixtures/classes.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/core/float/fixtures/coerce.rb | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/ruby/core/float/fixtures/classes.rb b/spec/ruby/core/float/fixtures/classes.rb new file mode 100644 index 0000000000..2d80184e7d --- /dev/null +++ b/spec/ruby/core/float/fixtures/classes.rb @@ -0,0 +1,4 @@ +module FloatSpecs + class CoerceError < StandardError + end +end diff --git a/spec/ruby/core/float/fixtures/coerce.rb b/spec/ruby/core/float/fixtures/coerce.rb new file mode 100644 index 0000000000..2cf155be95 --- /dev/null +++ b/spec/ruby/core/float/fixtures/coerce.rb @@ -0,0 +1,15 @@ +module FloatSpecs + class CanCoerce + def initialize(a) + @a = a + end + + def coerce(b) + [self.class.new(b), @a] + end + + def /(b) + @a.to_i % b.to_i + end + end +end |
