Sha256: f7be81975967aa5e58fd8bb895b1978666b49aaf3473685138e1a8be0c34e3e9

Contents?: true

Size: 1.17 KB

Versions: 11

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

include RR

class MyLogHelper
  include LogHelper
end

describe LogHelper do
  before(:each) do
  end

  it "should do nothing if the description fields are small enough" do
    MyLogHelper.new.fit_description_columns("bla", "blub").
      should == %w(bla blub)
  end

  it "should cut details to fit into the 'long_description' column" do
    MyLogHelper.new.fit_description_columns(
      "bla",
      "x" * (ReplicationInitializer::LONG_DESCRIPTION_SIZE - 1) + "yz").
      should == ["bla", "x" * (ReplicationInitializer::LONG_DESCRIPTION_SIZE - 1) + "y"]
  end

  it "should cut outcome to fit into the 'description' column" do
    MyLogHelper.new.fit_description_columns(
      "x" * (ReplicationInitializer::DESCRIPTION_SIZE - 1) + "yz",
      "blub")[0].
      should == "x" * (ReplicationInitializer::DESCRIPTION_SIZE - 1) + "y"
  end

  it "should carry over a long outcome into the 'long_description' column" do
    MyLogHelper.new.fit_description_columns(
      "x" * (ReplicationInitializer::DESCRIPTION_SIZE - 1) + "yz",
      "blub")[1].
      should == "x" * (ReplicationInitializer::DESCRIPTION_SIZE - 1) + "yz\nblub"
  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
andyjeffries-rubyrep-1.2.1 spec/log_helper_spec.rb
rubyrep-1.2.0 spec/log_helper_spec.rb
rubyrep-1.1.2 spec/log_helper_spec.rb
rubyrep-1.1.1 spec/log_helper_spec.rb
rubyrep-1.1.0 spec/log_helper_spec.rb
rubyrep-1.0.9 spec/log_helper_spec.rb
rubyrep-1.0.8 spec/log_helper_spec.rb
rubyrep-1.0.4 spec/log_helper_spec.rb
rubyrep-1.0.5 spec/log_helper_spec.rb
rubyrep-1.0.6 spec/log_helper_spec.rb
rubyrep-1.0.7 spec/log_helper_spec.rb