       }
     end
 
-    def struct_factory do
-      %{
-        __struct__: Foo.Bar
-      }
+    def foo_bar_factory do
+      %FooBar{}
     end
 
     def comment_factory(attrs) do

defmodule ExMachinaTest do
  use ExUnit.Case

  defmodule Factory do
    use ExMachina


    test "build/2 raises if passing invalid keys to a struct factory" do
      assert_raise KeyError, fn ->
        Factory.build(:foo_bar, doesnt_exist: true)
      end
    end

