Sha256: 053695db6660bc11e309c5b8bf402d8193d34d8cd4d0a335877a52a8d4df804d

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require "spec_helper"

describe MobileEnhancements::Configuration do
  subject do
    MobileEnhancements::Configuration.new
  end
  
  context "with no configuration settings defined" do
    it "should return nil for settings" do
      expect(subject.mobile.prefix).to be_nil
      expect(subject.mobile.layout).to be_nil
      expect(subject.desktop.layout).to be_nil
    end
  end
  
  describe "defining mobile configuration" do
    before do
      subject.mobile do
        prefix "m"
        layout "mob"
      end
    end
    
    it "should store the prefix" do
      expect(subject.mobile.prefix).to eq "m"
    end
    
    it "should store the layout" do
      expect(subject.mobile.layout).to eq "mob"
    end
    
    it "should raise method missing for undefined options" do
      expect { subject.mobile.banana(1,2) }.to raise_error(NoMethodError)
    end
  end
  
  describe "defining desktop configuration" do
    before do
      subject.desktop do
        layout "desktop"
      end
    end
    
    it "should store the layout" do
      expect(subject.desktop.layout).to eq "desktop"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mobile-enhancements-0.0.1 spec/mobile_enhancements/configuration_spec.rb