Sha256: e079c7e92b7fb2782a181cd86853e42798d7301e578e6b6e295949e782c95862

Contents?: true

Size: 1009 Bytes

Versions: 10

Compression:

Stored size: 1009 Bytes

Contents

require 'helper'

describe Trufflepig::FeatureList do
  describe "load" do
    before do
      @features = Trufflepig::FeatureList.load
    end

    it "returns a list of features" do
      feature_keys = @features.collect{|f| f["id"] }
      feature_keys.must_include "video"
      feature_keys.must_include "audio"
      feature_keys.must_include "canvas"

      feature = @features.select{|f| f["id"] == "video"}.first
      feature["categories"].must_equal ["HTML5"]
      feature["title"].must_equal "Video element"
    end
  end

  describe "build" do
    before do
      Trufflepig::FeatureList.build
      @features = Trufflepig::FeatureList.load
    end

    it "adds detection patterns to the features" do
      feature = @features.select{|f| f["id"] == "video"}.first
      feature["detection_pattern"].must_equal "<video.*>.*<\\/video>"

      feature = @features.select{|f| f["id"] == "offline-apps"}.first
      feature["detection_pattern"].must_equal "<html.*\\smanifest=.*>"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
trufflepig-0.2.13 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.12 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.11 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.10 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.9 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.8 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.7 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.6 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.5 spec/trufflepig/feature_list_spec.rb
trufflepig-0.2.4 spec/trufflepig/feature_list_spec.rb