Sha256: 0f0e4bbf59344b59f7ec0237254dafc2a64334789f17b29c3d4cb2a9c695cfe9
Contents?: true
Size: 1.23 KB
Versions: 34
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' describe Berkshelf::Mixin::DSLEval do let(:klass) do klass = Class.new klass.send(:include, described_class) klass end describe "ClassMethods" do describe "::clean_room" do subject { klass.clean_room } it "returns an anonymous class inheriting from DSLEval::CleanRoom" do expect(subject.superclass).to eql(described_class::CleanRoom) end end describe "::expose_method" do subject { klass } it "adds a method to the exposed methods" do klass.expose_method(:something) expect(subject.exposed_methods).to have(1).item end end describe "::exposed_methods" do it "returns an array" do expect(klass.exposed_methods).to be_a(Array) end end end describe "#dsl_eval" do subject do klass.new.dsl_eval { } end it "returns an instance of the including class" do expect(subject).to be_a(klass) end end describe "#dsl_eval_file" do let(:filepath) { tmp_path.join('somefile') } before { FileUtils.touch(filepath) } subject { klass.new.dsl_eval_file(filepath) } it "returns an instance of the including class" do expect(subject).to be_a(klass) end end end
Version data entries
34 entries across 34 versions & 1 rubygems