If you have any questions, comments, or suggestions we’d love to here from you at the Igloo Google group.
News about Igloo will also show up on Joakim’s twitter account: @jhkarlsson
If you have any questions, comments, or suggestions we’d love to here from you at the Igloo Google group.
News about Igloo will also show up on Joakim’s twitter account: @jhkarlsson
Very nice!
It would be even better if you add Mock features like in HippoMocks (www.assembla.com/wiki/show/hippomocks).
Thanks !
Igloo is great! It comes close to Gherkin-like specifications.
I’m using the following custom constraint for comparing floating point values:
#define EqualsDelta(a,b) Fulfills(IsEqualDelta((a), (b)))
struct IsEqualDelta
{
public:
IsEqualDelta(double expected, double delta)
: _delta(delta),
_expected(expected)
{ }
bool Matches(const double actual) const
{
return fabs(actual – _expected) < _delta;
}
friend std::ostream& operator<<(std::ostream& stm, const IsEqualDelta& );
private:
double _delta;
double _expected;
};
std::ostream& operator<<(std::ostream& stm, const IsEqualDelta& ied)
{
stm << "equal to " << ied._expected << " within delta " << ied._delta;
return stm;
}
Maybe it's an idea to add something similar.
Igloo is great! I couldn’t find a way to compare floating point values within a delta.
For this reason, I created the following custom constraint:
#define EqualsDelta(a,b) Fulfills(IsEqualDelta((a), (b)))
struct IsEqualDelta
{
public:
IsEqualDelta(double expected, double delta)
: _delta(delta),
_expected(expected)
{ }
bool Matches(const double actual) const
{
return fabs(actual – _expected) < _delta;
}
friend std::ostream& operator<<(std::ostream& stm, const IsEqualDelta& );
private:
double _delta;
double _expected;
};
std::ostream& operator<<(std::ostream& stm, const IsEqualDelta& ied)
{
stm << "equal to " << ied._expected << " within delta " << ied._delta;
return stm;
}
Is it possible to add something similar to igloo?
@Wim:
Looks like a good use of custom constraints.
We should definitely add deltas to the core constraints of Igloo.
/Joakim