Sha256: f96253ca79252b8f07f103e02a4de1672d435e9fed06e2a5ecb696c1220f6e86

Contents?: true

Size: 985 Bytes

Versions: 2

Compression:

Stored size: 985 Bytes

Contents

require 'spec_helper'
require 'it'

describe It::Plain, '.new' do
  it "should work with no params" do
    expect { It::Plain.new }.not_to raise_error
  end
  
  it "should work with a String" do
    expect { It::Plain.new("%s[http://www.rubyonrails.org]") }.not_to raise_error
  end
  
  it "should raise ArgumentError with 2 params" do
    expect { It::Plain.new("asdf", "asdf")}.to raise_error(ArgumentError, "wrong number of arguments (2 for 1)")
  end
  
  it "should raise a TypeError, if the first param is not a String" do
    expect { It::Plain.new(1)}.to raise_error(TypeError)
  end
end

describe It::Plain, '#process' do
  it "should return 'Ruby on Rails', if no param was given" do
    It::Plain.new.process("Ruby on Rails").should == 'Ruby on Rails'
  end
  
  it "should return 'Ruby on Rails[http://www.rubyonrails.org/]'" do
    It::Plain.new("%s[http://www.rubyonrails.org/]").process("Ruby on Rails").should == 'Ruby on Rails[http://www.rubyonrails.org/]'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
it-0.2.3 spec/it/plain_spec.rb
it-0.2.1 spec/it/plain_spec.rb