Why does this not compile, oh, what to do?
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItems;
ArrayList<Integer> actual = new ArrayList<Integer>();
ArrayList<Integer> expected = new ArrayList<Integer>();
actual.add(1);
expected.add(2);
assertThat(actual, hasItems(expected));
error copi...
I have the following models:
class User < ActiveRecord::Base
has_one :profile, :dependent => :destroy
def before_create
self.profile ||= Profile.new
end
end
class Profile < ActiveRecord::Base
belongs_to :user
validates_uniqueness_of :name
end
And I have the following factories:
Factory.define :user do |user|
...
If I have a Matcher[A] how do create a Matcher[Iterable[A]] that is satisfied only if each element of the Iterable satisfies the original Matcher.
class ExampleSpec extends Specification {
def allSatisfy[A](m: => Matcher[A]): Matcher[Iterable[A]] = error("TODO")
def notAllSatisfy[A](m: => Matcher[A]): Matcher[Iterable[A]] = allSati...