Sha256: 6e4228141c313f111e9ee41ea0155428a01d97a7ea1a7b73b72b1be66e30c335
Contents?: true
Size: 1.06 KB
Versions: 18
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true require "assert" require "much-rails/action/base_command_result" class MuchRails::Action::BaseCommandResult class UnitTests < Assert::Context desc "MuchRails::Action::BaseCommandResult" subject{ unit_class } let(:unit_class){ MuchRails::Action::BaseCommandResult } end class InitTests < UnitTests desc "when init" subject do unit_class.new( :do_something, "VALUE", other_value: "OTHER VALUE", ) end let(:controller1){ FakeController.new } should have_readers :command_name, :command_args should "know its attributes" do assert_that(subject.command_name).equals(:do_something) assert_that(subject.command_args) .equals(["VALUE", { other_value: "OTHER VALUE" }]) assert_that(controller1.instance_exec(subject, &subject.execute_block)) .equals(value: "VALUE", other_value: "OTHER VALUE") end end class FakeController def do_something(value, other_value:) { value: value, other_value: other_value } end end end
Version data entries
18 entries across 18 versions & 1 rubygems