spec/unit/sugarable_spec.rb in omnibus-5.5.0 vs spec/unit/sugarable_spec.rb in omnibus-5.6.0

- old
+ new

@@ -10,11 +10,11 @@ describe Metadata do it "extends Sugarable" do expect(described_class.singleton_class.included_modules).to include(Sugarable) end - it "includes Sugarable" do + it "is a sugarable" do expect(described_class.ancestors).to include(Sugarable) end end describe Packager::Base do @@ -45,15 +45,35 @@ expect(klass).to be_method_defined(:vagrant?) expect(klass).to be_method_defined(:_64_bit?) end it "makes the DSL methods available in the cleanroom" do - expect { + expect do instance.evaluate <<-EOH.gsub(/^ {12}/, "") windows? vagrant? EOH - }.to_not raise_error + end.to_not raise_error end + end + end + + describe Sugar do + let(:klass) do + Class.new do + include Sugar + end + end + + let(:instance) { klass.new } + + it "returns the windows architecture being built" do + expect(Omnibus::Config).to receive(:windows_arch).and_return(:x86_64) + expect(instance.windows_arch_i386?).to eq(false) + end + + it "returns whether fips_mode is enabled" do + expect(Omnibus::Config).to receive(:fips_mode).and_return(false) + expect(instance.fips_mode?).to eq(false) end end end