Sha256: c0ab0701940d1340c3f213499638922371384a8d0ed36c005f8c682567e811f4

Contents?: true

Size: 1.69 KB

Versions: 2

Compression:

Stored size: 1.69 KB

Contents

require 'spec_helper'
require 'catlogic'

describe "premise pair object" do

  	$major = Proposition.new(Quantity.new("universal"), Term.new("Mammals"), Quality.new("affirmative"), Term.new("Dogs"), true)
	$minor = Proposition.new(Quantity.new("universal"), Term.new("Mammals"), Quality.new("affirmative"), Term.new("Mortal Things"), true)
	$pair = PremisePair.new($major, $minor)

  it 'can return the major proposition' do
    result = $pair.major
    result.should == $major
  end

  it 'can return the minor proposition' do
    result = $pair.minor
    result.should == $minor
  end

  it 'can provide true result when this pair has three and only three distinct terms' do
  	result = $pair.three_term_pair?
  	result.should == true
  end

  it 'can return false result when this pair has only two distinct terms' do
  	major = Proposition.new(Quantity.new("universal"), Term.new("Mammals"), Quality.new("affirmative"), Term.new("Dogs"), true)
	minor = Proposition.new(Quantity.new("universal"), Term.new("Dogs"), Quality.new("affirmative"), Term.new("Mammals"), true)
	pair = PremisePair.new(major, minor)

  	result = pair.three_term_pair?
  	result.should == false
  end

  it 'can return false result when this pair has only four distinct terms' do
  	major = Proposition.new(Quantity.new("universal"), Term.new("Mammals"), Quality.new("affirmative"), Term.new("Dogs"), true)
	minor = Proposition.new(Quantity.new("universal"), Term.new("Cats"), Quality.new("affirmative"), Term.new("Wicked"), true)
	pair = PremisePair.new(major, minor)

  	result = pair.three_term_pair?
  	result.should == false
  end

  it 'can return middle term of pair' do 
  	result = $pair.middle
  	result.label.should == "Mammals"
  end

  


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
catlogic-0.0.2 spec/premise_pair_spec.rb
catlogic-0.0.1 spec/premise_pair_spec.rb