spec/kitchen/collection_spec.rb in test-kitchen-1.2.1 vs spec/kitchen/collection_spec.rb in test-kitchen-1.3.0
- old
+ new
@@ -14,49 +14,49 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-require_relative '../spec_helper'
-require 'ostruct'
+require_relative "../spec_helper"
+require "ostruct"
-require 'kitchen/collection'
+require "kitchen/collection"
describe Kitchen::Collection do
let(:collection) do
Kitchen::Collection.new([
- obj('one'), obj('two', 'a'), obj('two', 'b'), obj('three')
+ obj("one"), obj("two", "a"), obj("two", "b"), obj("three")
])
end
it "transparently wraps an Array" do
collection.must_be_instance_of Array
end
describe "#get" do
it "returns a single object by its name" do
- collection.get('three').must_equal obj('three')
+ collection.get("three").must_equal obj("three")
end
it "returns the first occurance of an object by its name" do
- collection.get('two').must_equal obj('two', 'a')
+ collection.get("two").must_equal obj("two", "a")
end
it "returns nil if an object cannot be found by its name" do
- collection.get('nope').must_be_nil
+ collection.get("nope").must_be_nil
end
end
describe "#get_all" do
it "returns a Collection of objects whose name matches the regex" do
result = collection.get_all(/(one|three)/)
result.size.must_equal 2
- result[0].must_equal obj('one')
- result[1].must_equal obj('three')
+ result[0].must_equal obj("one")
+ result[1].must_equal obj("three")
result.get_all(/one/).size.must_equal 1
end
it "returns an empty Collection if on matches are found" do
result = collection.get_all(/noppa/)
@@ -66,10 +66,10 @@
end
describe "#as_name" do
it "returns an Array of names as strings" do
- collection.as_names.must_equal %w{one two two three}
+ collection.as_names.must_equal %w[one two two three]
end
end
private