Sha256: a4296d7c8012b438fe62c6fb0bc2dc6ae3f9334f161f2bd063733b300c944c4c

Contents?: true

Size: 827 Bytes

Versions: 20

Compression:

Stored size: 827 Bytes

Contents

require "spec_helper"

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

  it "won't change when before and after are empty array" do
    expect(@array.order_by([])).to eq @array
  end

  it "will change by before items" do
    @array.order_by(["jquery.js", "vendor.js"])
    expect(@array).to eq %w[jquery.js vendor.js app.js bootstrap.css reset.css]
  end

  it "will change by after items" do
    @array.order_by(["...", "reset.css", "bootstrap.css"])
    expect(@array).to eq %w[app.js jquery.js vendor.js reset.css bootstrap.css]
  end

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

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
linner-hc-1.0.0 spec/linner/helper_spec.rb
linner-0.12.0 spec/linner/helper_spec.rb
linner-0.11.6 spec/linner/helper_spec.rb
linner-0.11.5 spec/linner/helper_spec.rb
linner-0.11.4 spec/linner/helper_spec.rb
linner-0.11.3 spec/linner/helper_spec.rb
linner-0.11.2 spec/linner/helper_spec.rb
linner-0.11.1 spec/linner/helper_spec.rb
linner-0.11.0 spec/linner/helper_spec.rb
linner-0.10.0 spec/linner/helper_spec.rb
linner-0.9.1 spec/linner/helper_spec.rb
linner-0.9.0 spec/linner/helper_spec.rb
linner-0.8.7 spec/linner/helper_spec.rb
linner-0.8.6 spec/linner/helper_spec.rb
linner-0.8.5 spec/linner/helper_spec.rb
linner-0.8.4 spec/linner/helper_spec.rb
linner-0.8.3 spec/linner/helper_spec.rb
linner-0.8.2 spec/linner/helper_spec.rb
linner-0.8.1 spec/linner/helper_spec.rb
linner-0.8.0 spec/linner/helper_spec.rb