Sha256: 6e9164ece97120849f2be10cb3b7c8e7f8e2e49c30ee2caf76cfa56893773bbc
Contents?: true
Size: 1.37 KB
Versions: 10
Compression:
Stored size: 1.37 KB
Contents
require 'spec_helper' require 'simple_command' describe 'Mutations - inheritance' do class SimpleInherited < SimpleCommand required do integer :age end def execute inputs end end it 'should filter with inherited command' do mutation = SimpleInherited.run(:name => "bob", :email => "jon@jones.com", :age => 10, :amount => 22) assert mutation.success? assert_equal HashWithIndifferentAccess.new(:name => "bob", :email => "jon@jones.com", :age => 10, :amount => 22), mutation.result end it 'should filter with original command' do mutation = SimpleCommand.run(:name => "bob", :email => "jon@jones.com", :age => 10, :amount => 22) assert mutation.success? assert_equal HashWithIndifferentAccess.new(:name => "bob", :email => "jon@jones.com", :amount => 22), mutation.result end it 'shouldnt collide' do mutation = SimpleInherited.run(:name => "bob", :email => "jon@jones.com", :age => 10, :amount => 22) assert mutation.success? assert_equal HashWithIndifferentAccess.new(:name => "bob", :email => "jon@jones.com", :age => 10, :amount => 22), mutation.result mutation = SimpleCommand.run(:name => "bob", :email => "jon@jones.com", :age => 10, :amount => 22) assert mutation.success? assert_equal HashWithIndifferentAccess.new(:name => "bob", :email => "jon@jones.com", :amount => 22), mutation.result end end
Version data entries
10 entries across 10 versions & 1 rubygems