spec/spec_helper.rb in punchblock-1.5.3 vs spec/spec_helper.rb in punchblock-1.6.0
- old
+ new
@@ -53,49 +53,38 @@
di.headers.each { |i| control.include?(i).should be_true }
end
end
shared_examples_for 'event_headers' do
- its(:headers) { should be == [Punchblock::Header.new(:x_skill, 'agent'), Punchblock::Header.new(:x_customer_id, '8877')]}
+ its(:headers) { should be == [Punchblock::Header.new('X-skill', 'agent'), Punchblock::Header.new('X-customer-id', '8877')]}
its(:headers_hash) { should be == {:x_skill => 'agent', :x_customer_id => '8877'} }
end
shared_examples_for 'key_value_pairs' do
it 'will auto-inherit nodes' do
n = parse_stanza "<#{element_name} name='boo' value='bah' />"
- h = class_name.new n.root
- h.name.should be == :boo
+ h = described_class.new n.root
+ h.name.should be == 'boo'
h.value.should be == 'bah'
end
it 'has a name attribute' do
- n = class_name.new :boo, 'bah'
- n.name.should be == :boo
+ n = described_class.new :boo, 'bah'
+ n.name.should be == 'boo'
n.name = :foo
- n.name.should be == :foo
+ n.name.should be == 'foo'
end
- it "substitutes - for _ on the name attribute when reading" do
- n = parse_stanza "<#{element_name} name='boo-bah' value='foo' />"
- h = class_name.new n.root
- h.name.should be == :boo_bah
- end
-
- it "substitutes _ for - on the name attribute when writing" do
- h = class_name.new :boo_bah, 'foo'
- h.to_xml.should be == "<#{element_name} name=\"boo-bah\" value=\"foo\"/>"
- end
-
it 'has a value param' do
- n = class_name.new :boo, 'en'
+ n = described_class.new :boo, 'en'
n.value.should be == 'en'
n.value = 'de'
n.value.should be == 'de'
end
it 'can determine equality' do
- a = class_name.new :boo, 'bah'
- a.should be == class_name.new(:boo, 'bah')
- a.should_not be == class_name.new(:bah, 'bah')
- a.should_not be == class_name.new(:boo, 'boo')
+ a = described_class.new :boo, 'bah'
+ a.should be == described_class.new(:boo, 'bah')
+ a.should_not be == described_class.new(:bah, 'bah')
+ a.should_not be == described_class.new(:boo, 'boo')
end
end