function Expectation.new(g)local n={value=g,successCondition=true;condition=false}setmetatable(n,Expectation)n.a=bindSelf(n,n.a)n.an=n.a n.ok=bindSelf(n,n.ok)n.equal=bindSelf(n,n.equal)n.throw=bindSelf(n,n.throw)n.near=bindSelf(n,n.near)return n end function Expectation.__index(g,n)if SELF_KEYS[n]then return g end if NEGATION_KEYS[n]then local n=Expectation.new(g.value)n.successCondition=not g.successCondition return n end return Expectation[n]end

function Expectation.new(value)
	local self = {
		value = value,
		successCondition = true,
		condition = false
	}

	setmetatable(self, Expectation)

	self.a = bindSelf(self, self.a)
	self.an = self.a
	self.ok = bindSelf(self, self.ok)
	self.equal = bindSelf(self, self.equal)
	self.throw = bindSelf(self, self.throw)
	self.near = bindSelf(self, self.near)

	return self
end

function Expectation.__index(self, key)
	-- Keys that don't do anything except improve readability
	if SELF_KEYS[key] then
		return self
	end

	-- Invert your assertion
	if NEGATION_KEYS[key] then
		local newExpectation = Expectation.new(self.value)
		newExpectation.successCondition = not self.successCondition

		return newExpectation
	end

	-- Fall back to methods provided by Expectation
	return Expectation[key]
end
