artichoke_backend/extn/core/encoding/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//! Encoding represents a character encoding usable in Ruby
//!
//! This module implements the [`Encoding`] class from Ruby Core.
//!
//! You can use this class in your application by accessing it directly. As a
//! Core class, it is globally available:
//!
//! ```ruby
//! Encoding.list
//! ```
//!
//! [`Encoding`]: https://ruby-doc.org/3.1.2/Encoding.html

pub(in crate::extn) mod mruby;

struct Encoding {}

#[cfg(test)]
mod tests {
    use crate::test::prelude::*;

    const SUBJECT: &str = "Encoding";
    const FUNCTIONAL_TEST: &[u8] = include_bytes!("encoding_test.rb");

    #[test]
    fn functional() {
        let mut interp = interpreter();
        let result = interp.eval(FUNCTIONAL_TEST);
        unwrap_or_panic_with_backtrace(&mut interp, SUBJECT, result);
        let result = interp.eval(b"spec");
        unwrap_or_panic_with_backtrace(&mut interp, SUBJECT, result);
    }
}