#!/usr/bin/perl
# Test some basics of the environment.
#use Mooix::Thing;
#use Mooix::Verb;
use Cwd q{abs_path};
use Test::More tests => 10, import => ['!fail'];
run sub {
	my $this=shift;
	ok(1, "run works");
	isa_ok($this, "Mooix::Thing", "thing passed");
	is($this->id, abs_path("."), "start in object directory");
	ok($this == Mooix::Thing->get("."), "get works (== overloading too)");
	my @input=("hi", "bye", '"quoted text"', "multiline\n\n\nstring", $this);
	ok(eq_array([$this->return_input(@input)],\@input),
		    "make sure return works");
	is($? & 127, 0, "method did not die of signal");
	is($? >> 8, 0, "method call returned 0");
	ok(eq_array([$this->fail_input("I failed")],["I failed"]),
		    "make sure failing with simple return value works");
	is($? & 127, 0, "method did not die of signal");
	is($? >> 8, Mooix::Verb::FAIL, "failing method call returns FAIL");
}
