Sha256: 4dbb8b2c8a1b73335e219b87ebcf88a8d6d0405f54362a9289791b622bd8f6d7
Contents?: true
Size: 1.37 KB
Versions: 1
Compression:
Stored size: 1.37 KB
Contents
require "spec_helper" module Hexx describe Settings do around do |example| module TestModule; include Settings; end class TestClass; end example.run Hexx.send :remove_const, :TestClass Hexx.send :remove_const, :TestModule end let!(:subject) { TestModule } describe ".configure" do it "is public" do expect(subject).to respond_to(:configure).with(0).arguments end it "sends itself to a block" do subject.configure do |c| expect(c).to eq subject end end end describe ".depends_on" do it "is public" do expect(subject).to respond_to(:depends_on).with(1).argument end it "defines name settings accessor" do subject.depends_on :test_class expect(subject).to respond_to(:test_class_name).with(0).arguments expect(subject).to respond_to(:test_class_name=).with(1).argument expect { subject.test_class_name = "TestClass" } .to change { subject.test_class_name }.from(nil).to "TestClass" end it "defines corresponding constant reader" do subject.depends_on :test_class expect(subject).to respond_to(:test_class).with(0).arguments expect { subject.test_class_name = "Hexx::TestClass" } .to change { subject.test_class }.from(nil).to TestClass end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hexx-0.0.1 | spec/hexx/settings_spec.rb |