Sha256: ebc1f2ceaff66237a0bf2f74d60775a2ae613c8cd5aa33c1526092e81895aeee

Contents?: true

Size: 925 Bytes

Versions: 1

Compression:

Stored size: 925 Bytes

Contents

require "spec_helper"

describe Array do
  before(:each) do
    @array = %w[app.js jquery.js bootstrap.css reset.css vendor.js]
  end

  describe :sort do
    it "won't change when before and after are empty array" do
      @array.order_by(before:[], after:[]).should be_equal @array
    end

    it "will change by before items" do
      @array.order_by(before:["jquery.js", "vendor.js"], after:[])
      @array.should =~ %w[jquery.js vendor.js app.js bootstrap.css reset.css]
    end

    it "will change by after items" do
      @array.order_by(before:[], after:["reset.css", "bootstrap.css"])
      @array.should =~ %w[app.js jquery.js vendor.js reset.css bootstrap.css]
    end

    it "will change by before and after items" do
      @array.order_by(before:["jquery.js", "vendor.js"], after:["reset.css", "bootstrap.css"])
      @array.should =~ %w[jquery.js vendor.js app.js reset.css bootstrap.css]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linner-0.2.0 spec/linner/helper_spec.rb