Skip to content

Commit

Permalink
stub Decomposition class
Browse files Browse the repository at this point in the history
  • Loading branch information
chastell committed Mar 1, 2009
1 parent 58bcf74 commit 13d8d16
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/art-decomp.rb
Expand Up @@ -3,3 +3,4 @@
require 'set'

require 'art-decomp/decomposer'
require 'art-decomp/decomposition'
13 changes: 13 additions & 0 deletions lib/art-decomp/decomposition.rb
@@ -0,0 +1,13 @@
module ArtDecomp class Decomposition

attr_reader :fsm, :u, :v, :qu, :qv, :g

def initialize fsm, u, v, qu, qv, g
@fsm, @u, @v, @qu, @qv, @g = fsm, u, v, qu, qv, g
end

def == other
[@fsm, @u, @v, @qu, @qv, @g] == [other.fsm, other.u, other.v, other.qu, other.qv, other.g]
end

end end
11 changes: 11 additions & 0 deletions spec/art-decomp/decomposition_spec.rb
@@ -0,0 +1,11 @@
describe Decomposition do

it 'should instantiate and compare properly' do
fsm = mock 'FSM'
u, v = [0,1], [2]
qu, qv, g = mock('Blanket'), mock('Blanket'), mock('Blanket')
dec = Decomposition.new fsm, u, v, qu, qv, g
[dec.fsm, dec.u, dec.v, dec.qu, dec.qv, dec.g].should == [fsm, u, v, qu, qv, g]
end

end

0 comments on commit 13d8d16

Please sign in to comment.