Sha256: 7ec3995ebf6363e5f31262d1e41f998e62226cc74785b23f912750d0d8f646f6

Contents?: true

Size: 811 Bytes

Versions: 20

Compression:

Stored size: 811 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
    @array.order_by([]).should == @array
  end

  it "will change by before items" do
    @array.order_by(["jquery.js", "vendor.js"])
    @array.should == %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"])
    @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(["jquery.js", "vendor.js", "...", "reset.css", "bootstrap.css"])
    @array.should == %w[jquery.js vendor.js app.js reset.css bootstrap.css]
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
linner-0.7.3 spec/linner/helper_spec.rb
linner-0.7.2 spec/linner/helper_spec.rb
linner-0.7.1 spec/linner/helper_spec.rb
linner-0.7.0 spec/linner/helper_spec.rb
linner-0.6.7 spec/linner/helper_spec.rb
linner-0.6.6 spec/linner/helper_spec.rb
linner-0.6.5 spec/linner/helper_spec.rb
linner-0.6.4 spec/linner/helper_spec.rb
linner-0.6.3 spec/linner/helper_spec.rb
linner-0.6.2 spec/linner/helper_spec.rb
linner-0.6.1 spec/linner/helper_spec.rb
linner-0.6.0 spec/linner/helper_spec.rb
linner-0.5.1 spec/linner/helper_spec.rb
linner-0.5.0 spec/linner/helper_spec.rb
linner-0.4.6 spec/linner/helper_spec.rb
linner-0.4.5 spec/linner/helper_spec.rb
linner-0.4.4 spec/linner/helper_spec.rb
linner-0.4.3 spec/linner/helper_spec.rb
linner-0.4.2 spec/linner/helper_spec.rb
linner-0.4.1 spec/linner/helper_spec.rb