summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMichael Granger <ged@FaerieMUD.org>2012-01-24 14:40:50 -0800
committerMichael Granger <ged@FaerieMUD.org>2012-01-24 14:40:50 -0800
commit7f6f229bd94402731552c437874091582e6fe0d7 (patch)
tree9685ea87f76a159391f452cc41a7e764d4810e3c /spec
parent84b5236f23717f0070a90b481554289975fb65d9 (diff)
downloaddiff-lcs-7f6f229bd94402731552c437874091582e6fe0d7.tar.gz
Fix+specs for Diff::LCS::ChangeTypeTests predicates
Diffstat (limited to 'spec')
-rw-r--r--spec/change_spec.rb70
1 files changed, 70 insertions, 0 deletions
diff --git a/spec/change_spec.rb b/spec/change_spec.rb
new file mode 100644
index 0000000..9595732
--- /dev/null
+++ b/spec/change_spec.rb
@@ -0,0 +1,70 @@
+# -*- ruby encoding: utf-8 -*-
+
+require 'spec_helper'
+
+describe Diff::LCS::Change do
+
+ describe "an add" do
+ subject { described_class.new('+', 0, 'element') }
+ it { should_not be_deleting() }
+ it { should be_adding() }
+ it { should_not be_unchanged() }
+ it { should_not be_changed() }
+ it { should_not be_finished_a() }
+ it { should_not be_finished_b() }
+ end
+
+ describe "a delete" do
+ subject { described_class.new('-', 0, 'element') }
+ it { should be_deleting() }
+ it { should_not be_adding() }
+ it { should_not be_unchanged() }
+ it { should_not be_changed() }
+ it { should_not be_finished_a() }
+ it { should_not be_finished_b() }
+ end
+
+ describe "an unchanged" do
+ subject { described_class.new('=', 0, 'element') }
+ it { should_not be_deleting() }
+ it { should_not be_adding() }
+ it { should be_unchanged() }
+ it { should_not be_changed() }
+ it { should_not be_finished_a() }
+ it { should_not be_finished_b() }
+ end
+
+ describe "a changed" do
+ subject { described_class.new('!', 0, 'element') }
+ it { should_not be_deleting() }
+ it { should_not be_adding() }
+ it { should_not be_unchanged() }
+ it { should be_changed() }
+ it { should_not be_finished_a() }
+ it { should_not be_finished_b() }
+ end
+
+ describe "a finished_a" do
+ subject { described_class.new('>', 0, 'element') }
+ it { should_not be_deleting() }
+ it { should_not be_adding() }
+ it { should_not be_unchanged() }
+ it { should_not be_changed() }
+ it { should be_finished_a() }
+ it { should_not be_finished_b() }
+ end
+
+ describe "a finished_b" do
+ subject { described_class.new('<', 0, 'element') }
+ it { should_not be_deleting() }
+ it { should_not be_adding() }
+ it { should_not be_unchanged() }
+ it { should_not be_changed() }
+ it { should_not be_finished_a() }
+ it { should be_finished_b() }
+ end
+
+
+end
+
+# vim: ft=ruby