spec/onstomp/components/frame_headers_spec.rb in onstomp-1.0.0pre1 vs spec/onstomp/components/frame_headers_spec.rb in onstomp-1.0.0
- old
+ new
@@ -4,14 +4,11 @@
module OnStomp::Components
describe FrameHeaders do
let(:headers) {
FrameHeaders.new
}
- let(:enumerator_module) {
- RUBY_VERSION >= '1.9' ? Enumerator : Enumerable::Enumerator
- }
-
+
describe ".initialize" do
it "should create an empty set of headers" do
FrameHeaders.new.names.should == []
end
it "should create headers initialized by a hash" do
@@ -131,10 +128,10 @@
it "should be a kind of enumerable" do
headers.should be_a_kind_of(Enumerable)
end
it "should yield an enumerator if called without a block" do
- headers.each.should be_a_kind_of(enumerator_module)
+ headers.each.should be_a_kind_of(OnStomp::ENUMERATOR_KLASS)
end
it "should yield header names and values as pairs of strings" do
yielded = []
headers[:named1] = 'value 1'