Sha256: f21aecc0150b78cd2a2f63feac03d240c4d59fdbd92f05147b019c39e7f98874

Contents?: true

Size: 605 Bytes

Versions: 1

Compression:

Stored size: 605 Bytes

Contents

require 'spec_helper'

describe DiviningRod::Mapper do
  
  before :each do
    @root_definition = DiviningRod::Definition.new { true }
    mapper = DiviningRod::Mapper.new(@root_definition, {:tags => [:fuck], :foo => true})
    mapper.ua /Safari/, :tags => [:baz] do |map|
      map.with_options :tags => :awsome do |awesome|
        awesome.ua /Apple/, :tags => [:foo]
      end
    end
  end
  
  it "should map a definition" do
    request = request_mock(:ua => 'Apple Mobile Safari', :format => :html)
    result = @root_definition.evaluate(request)
    result.tags.should include(:fuck)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
divining_rod-0.5.0 spec/mapper_spec.rb