spec/commnad_spec.rb in command_mapper-0.1.1 vs spec/commnad_spec.rb in command_mapper-0.1.2

- old
+ new

@@ -5,10 +5,13 @@ module TestCommand class WithCommandName < CommandMapper::Command command 'foo' end + class InheritedCommandName < WithCommandName + end + class NoCommandName < CommandMapper::Command end end it "must include Types" do @@ -47,9 +50,17 @@ context "when @command_name has been set" do let(:command_class) { TestCommand::WithCommandName } it "must set .command_name" do expect(subject.command_name).to eq('foo') + end + end + + context "when the command class inherits from another command class" do + let(:command_class) { TestCommand::InheritedCommandName } + + it "must check the superclass" do + expect(subject.command_name).to eq("foo") end end end module TestCommand