From cf013d93073b372a07e93796e154cf933c042b36 Mon Sep 17 00:00:00 2001 From: Joe Fredette Date: Mon, 14 Nov 2011 08:00:48 -0500 Subject: [PATCH] update acceptance criterion --- spec/fixtures/rc | 1 + spec/fixtures/semantic_acceptance/rc | 1 + spec/semantic_spec.rb | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/spec/fixtures/rc b/spec/fixtures/rc index b60052f..a5f4c0c 100644 --- a/spec/fixtures/rc +++ b/spec/fixtures/rc @@ -6,6 +6,7 @@ sortah do router do raise RuntimeException if email.from && email.from.any? { |e| e =~ /fail/ } + send_to :dynamic => "bar" if email.from && email.from.any? { |e| e =~ /dynamic/ } send_to :foo end end diff --git a/spec/fixtures/semantic_acceptance/rc b/spec/fixtures/semantic_acceptance/rc index c98f0a5..1e3bb99 100644 --- a/spec/fixtures/semantic_acceptance/rc +++ b/spec/fixtures/semantic_acceptance/rc @@ -35,6 +35,7 @@ sortah do end router do + send_to :dynamic => "bar" if email.from && email.from.any? { |e| e =~ /dynamic/ } send_to :personal if email.to.any? { |r| r =~ /jfredett@place.com/ } send_to :work if email.to.any? { |r| r =~ /joe@work.com/ } send_to :unknown diff --git a/spec/semantic_spec.rb b/spec/semantic_spec.rb index 59bd23b..3be83a9 100644 --- a/spec/semantic_spec.rb +++ b/spec/semantic_spec.rb @@ -373,9 +373,17 @@ def basic_sortah_definition #shuttup, I can dream. end + dynamic_email = Mail.new do + to 'joe@work.com' + from 'dynamic@work.com' + subject 'this is a dynamic email' + #shuttup, I can dream. + end + sortah.sort(@email).destination.should == 'new/' sortah.sort(personal_email).destination.should == 'personal/sarah/new/' sortah.sort(work_email).destination.should == 'work/brian/new/' + sortah.sort(dynamic_email).destination.should == 'bar' end end end