<commit_before>require 'spec_helper'

describe 'opal-node' do
  it 'executes a script that prints "hello world"' do
    hello_world = a_file_with_name 'hello_world.rb', and_contents: "puts 'hello world!'\n"
    opal_node(hello_world).should eq("hello world!\n")
  end

  it 'can require .rb files' do
    hello_world = a_file_with_name 'hello_world.rb', and_contents: "puts 'hello world!'\n"
    requiring   = a_file_with_name 'requiring.rb',   and_contents: "require './hello_world'\n"<commit_msg>Add a spec to test requires<commit_after>require 'spec_helper'

describe 'opal-node' do
  it 'executes a script that prints "hello world"' do
    hello_world = a_file_with_name 'hello_world.rb', and_contents: "puts 'hello world!'\n"
    opal_node(hello_world).should eq("hello world!\n")
  end

  it 'can require .rb files' do
    hello_world = a_file_with_name 'hello_world.rb', and_contents: "puts 'hello world!'\n"
    requiring   = a_file_with_name 'requiring.rb',   and_contents: "require './hello_world'\n"
    opal_node(requiring).should eq("hello world!\n")
  end

  it 'can require .rb files with explicit extension' do
    hello_world = a_file_with_name 'hello_world.rb', and_contents: "puts 'hello world!'\n"
    requiring   = a_file_with_name 'requiring.rb',   and_contents: "require './hello_world.rb'\n"
{'fraction_non_alphanumeric': 0.12167300380228137, 'fraction_numerical': 0.0, 'mean_word_length': 4.552742616033755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3677781', 'n_tokens_mistral': 465, 'n_tokens_neox': 450, 'n_words': 118}