Skip to content
Snippets Groups Projects
Commit 2b782f89 authored by Rory Jennings's avatar Rory Jennings
Browse files

test: fix test failures

parent 815edcfc
No related branches found
No related tags found
1 merge request!1fix: add a newline and an instantiator to generators
Pipeline #8364 passed
...@@ -16,7 +16,7 @@ describe NexusCqrs::CommandGenerator, type: :generator do ...@@ -16,7 +16,7 @@ describe NexusCqrs::CommandGenerator, type: :generator do
end end
it "creates the registration config file for handlers" do it "creates the registration config file for handlers" do
line = "$COMMAND_EXECUTOR.register_command(TestCommand, TestCommandHandler)" line = "$COMMAND_EXECUTOR.register_command(TestCommand, TestCommandHandler.new)"
base_path = File.expand_path("../../tmp", __FILE__) base_path = File.expand_path("../../tmp", __FILE__)
expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line)) expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line))
end end
...@@ -34,7 +34,7 @@ describe NexusCqrs::CommandGenerator, type: :generator do ...@@ -34,7 +34,7 @@ describe NexusCqrs::CommandGenerator, type: :generator do
end end
it "creates the registration config file for handlers" do it "creates the registration config file for handlers" do
line = "$COMMAND_EXECUTOR.register_command(Test::TestCommand, Test::TestCommandHandler)" line = "$COMMAND_EXECUTOR.register_command(Test::TestCommand, Test::TestCommandHandler.new)"
base_path = File.expand_path("../../tmp", __FILE__) base_path = File.expand_path("../../tmp", __FILE__)
expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line)) expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line))
end end
......
...@@ -16,7 +16,7 @@ describe NexusCqrs::QueryGenerator, type: :generator do ...@@ -16,7 +16,7 @@ describe NexusCqrs::QueryGenerator, type: :generator do
end end
it "creates the registration config file for handlers" do it "creates the registration config file for handlers" do
line = "$QUERY_EXECUTOR.register_command(TestQuery, TestQueryHandler)" line = "$QUERY_EXECUTOR.register_command(TestQuery, TestQueryHandler.new)"
base_path = File.expand_path("../../tmp", __FILE__) base_path = File.expand_path("../../tmp", __FILE__)
expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line)) expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line))
end end
...@@ -34,7 +34,7 @@ describe NexusCqrs::QueryGenerator, type: :generator do ...@@ -34,7 +34,7 @@ describe NexusCqrs::QueryGenerator, type: :generator do
end end
it "creates the registration config file for handlers" do it "creates the registration config file for handlers" do
line = "$QUERY_EXECUTOR.register_command(Test::TestQuery, Test::TestQueryHandler)" line = "$QUERY_EXECUTOR.register_command(Test::TestQuery, Test::TestQueryHandler.new)"
base_path = File.expand_path("../../tmp", __FILE__) base_path = File.expand_path("../../tmp", __FILE__)
expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line)) expect(File.read(base_path + "/config/initializers/register_cqrs_handlers.rb")).to(include(line))
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment