Sha256: 516e8610ed985ea79b1699a3c30b246201f514341c7d0248aa96c339232b69fc

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

#include <catch.hpp>
#include <facter/facts/scalar_value.hpp>
#include <facter/ruby/ruby.hpp>
#include <internal/ruby/ruby_value.hpp>
#include <leatherman/ruby/api.hpp>
#include "../fixtures.hpp"
#include "../collection_fixture.hpp"
#include "./ruby_helper.hpp"

#include "../mock_server.hpp"

using namespace std;
using namespace facter::ruby;
using namespace facter::testing;
using namespace leatherman::ruby;

SCENARIO("directories of custom facts written in Ruby") {
    collection_fixture facts;
    REQUIRE(facts.size() == 0u);

    // Setup ruby
    auto& ruby = api::instance();
    REQUIRE(ruby.initialized());
    ruby.include_stack_trace(true);

    string fixtures = LIBFACTER_TESTS_DIRECTORY "/fixtures/ruby/";

    GIVEN("a fact that performs network activity") {
        facter::mock_server m(42000);
        load_custom_facts(facts, vector<string>{fixtures+"custom_dir"});
        THEN("the network location should resolve") {
            REQUIRE(ruby_value_to_string(facts.get<ruby_value>("sometest")) == "\"Yay\"");
        }
    }
}

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.12.1.cfacter.20181031 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.6.cfacter.20181031 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.12.1.cfacter.20181023 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.5.cfacter.20181022 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.12.0.cfacter.20181004 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.12.0.cfacter.20181001 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.12.0.cfacter.20180918 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.4.cfacter.20180821 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.3.cfacter.20180716 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.2.cfacter.20180612 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.9.6.cfacter.20180612 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.2.cfacter.20180606 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.9.6.cfacter.20180606 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
facter-3.11.0.cfacter.20180319 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc
cfacter-3.11.0.rc.20180314 ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc