You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
569 B

require 'spec_helper'
describe Squib::DSL do
let(:deck) { Squib::Deck.new }
Squib::DSL.constants.each do |m|
it "method #{m} calls warn_if_unexpected" do
method_obj = Squib::DSL.const_get(m).new(deck, m)
expect(method_obj).to receive(:warn_if_unexpected).and_throw(:warned)
catch :warned do
method_obj.run({})
end
end
it "method #{m} has dsl_method and deck defined" do
method_obj = Squib::DSL.const_get(m).new(deck, m)
expect(method_obj).to have_attributes({deck: deck, dsl_method: m})
end
end
end