Sha256: cc5a10e29a35efc595821887738334ec6f0df0ba476eebf8c70084eea3a23247

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Daijobu::Scheme do
  
  describe ".get" do
    
    describe "with :marshal" do
      it "should return a marshal scheme" do
        Daijobu::Scheme.get(:marshal).should be_an_instance_of(Daijobu::Scheme::Marshal)
      end
    end

    describe "with :json" do
      it "should return a json scheme" do
        Daijobu::Scheme.get(:json).should be_an_instance_of(Daijobu::Scheme::JSON)
      end
    end

    describe "with :yaml" do
      it "should return a yaml scheme" do
        Daijobu::Scheme.get(:yaml).should be_an_instance_of(Daijobu::Scheme::YAML)
      end
    end

    describe "with :eval" do
      it "should return a eval scheme" do
        Daijobu::Scheme.get(:eval).should be_an_instance_of(Daijobu::Scheme::Eval)
      end
    end
    
    describe "with anything else" do
      it "should raise an error" do
        lambda { Daijobu::Scheme.get(:xml) }.should raise_error(Daijobu::UnknownScheme)
      end
    end
    
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sander6-daijobu-0.1.0 spec/daijobu/scheme_spec.rb
sander6-daijobu-0.1.1 spec/daijobu/scheme_spec.rb
sander6-daijobu-0.2.0 spec/daijobu/scheme_spec.rb
sander6-daijobu-0.2.1 spec/daijobu/scheme_spec.rb