Sha256: e691b0a376af1d4ef73e94f8ed5e8ce1bd7d7804f6948ba2e666444d080afd19

Contents?: true

Size: 827 Bytes

Versions: 9

Compression:

Stored size: 827 Bytes

Contents

# -*- encoding: utf-8 -*-

require './spec/helper'

describe "Standard class String extensions" do

  it "should replace a markdown file ext" do
    string = "file.markdown"
    result = string.force_html_extension
    result.should == "file.html"
  end
  
  it "should replace a markdown file ext !" do
    string = "file.markdown"
    string.force_html_extension!
    string.should == "file.html"
  end
  
  it "should not replace an other file ext" do
    string = "file.txt"
    string.force_html_extension!
    string.should == "file.txt"
  end
  
  it "should say if it has a markdown file extension" do
    string = "file.markdown"
    string.markdown_ext?.should be_true
  end
  
  it "should say if it has not a markdown file extension" do
    string = "file.other"
    string.markdown_ext?.should be_false
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
genit-2.0 spec/extensions_spec.rb
genit-1.0.1 spec/extensions_spec.rb
genit-1.0 spec/extensions_spec.rb
genit-0.99 spec/extensions_spec.rb
genit-0.9 spec/extensions_spec.rb
genit-0.5 spec/extensions_spec.rb
genit-0.4.1 spec/extensions_spec.rb
genit-0.4 spec/extensions_spec.rb
genit-0.3 spec/extensions_spec.rb