Sha256: 1e0d8476a4b8e680f982cb716ecbead2148dadd5cb69eae428caa8c1776ef77d

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

require 'spec_helper'
require 'ronin/campaign'

describe Campaign do
  describe "filename" do
    it "should return nil if no name is set" do
      campaign = Campaign.new
      
      campaign.filename.should be_nil
    end

    it "should downcase the campaign name" do
      campaign = Campaign.new(:name => 'Stuff')

      campaign.filename.should == 'stuff'
    end

    it "should replace spaces with underscores" do
      campaign = Campaign.new(:name => 'More   Stuff')

      campaign.filename.should == 'more_stuff'
    end

    it "should replace non-alpha-numeric characters with undersocres" do
      campaign = Campaign.new(:name => 'Stuff / stuff1 & stuff2')

      campaign.filename.should == 'stuff_stuff1_stuff2'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ronin-1.0.0.pre3 spec/campaign_spec.rb
ronin-1.0.0.pre2 spec/campaign_spec.rb
ronin-1.0.0.pre1 spec/campaign_spec.rb