spec/dslable_dsl_spec.rb in dslable-0.0.2 vs spec/dslable_dsl_spec.rb in dslable-0.0.3

- old
+ new

@@ -1,34 +1,34 @@ # encoding: utf-8 -require "spec_helper" -require "dslable_dsl" +require 'spec_helper' +require 'dslable_dsl' describe Dslable::Dsl do context :gem_name do cases = [ { case_no: 1, - case_title: "valid gem name", - input: "abcdefghijklmnopqrstuvwxyz01234567891_", - expected: "abcdefghijklmnopqrstuvwxyz01234567891_" + case_title: 'valid gem name', + input: 'abcdefghijklmnopqrstuvwxyz01234567891_', + expected: 'abcdefghijklmnopqrstuvwxyz01234567891_' }, { case_no: 2, - case_title: "empty gem name", - input: "", + case_title: 'empty gem name', + input: '', expect_error: true }, { case_no: 3, - case_title: "nil gem name", + case_title: 'nil gem name', input: nil, expect_error: true }, { case_no: 4, - case_title: "invalid gem name contain space", - input: "gem name", + case_title: 'invalid gem name contain space', + input: 'gem name', expect_error: true }, ] cases.each do |c| @@ -39,11 +39,11 @@ # -- given -- dslable_dsl = Dslable::Dsl.new # -- when -- if c[:expect_error] - lambda {dslable_dsl.gem_name c[:input]}.should raise_error(Dslable::InvalidDslError) + lambda { dslable_dsl.gem_name c[:input] }.should raise_error(Dslable::InvalidDslError) next end dslable_dsl.gem_name c[:input] actual = dslable_dsl._gem_name @@ -66,23 +66,23 @@ context :gem_desc do cases = [ { case_no: 1, - case_title: "valid gem desc", - input: "abcdefghijklmnopqrstuvwxyz01234567891_", - expected: "abcdefghijklmnopqrstuvwxyz01234567891_" + case_title: 'valid gem desc', + input: 'abcdefghijklmnopqrstuvwxyz01234567891_', + expected: 'abcdefghijklmnopqrstuvwxyz01234567891_' }, { case_no: 2, - case_title: "empty gem desc", - input: "", + case_title: 'empty gem desc', + input: '', expect_error: true }, { case_no: 3, - case_title: "nil gem desc", + case_title: 'nil gem desc', input: nil, expect_error: true }, ] @@ -94,11 +94,11 @@ # -- given -- dslable_dsl = Dslable::Dsl.new # -- when -- if c[:expect_error] - lambda {dslable_dsl.gem_desc c[:input]}.should raise_error(Dslable::InvalidDslError) + lambda { dslable_dsl.gem_desc c[:input] }.should raise_error(Dslable::InvalidDslError) next end dslable_dsl.gem_desc c[:input] actual = dslable_dsl._gem_desc @@ -121,19 +121,19 @@ context :field do cases = [ { case_no: 1, - case_title: "case_title", + case_title: 'case_title', input_field_name: :field_name, - input_field_desc: "field_desc", + input_field_desc: 'field_desc', input_args_name: :args_name, - input_args_desc: "args_desc", + input_args_desc: 'args_desc', expected_field_name: :field_name, - expected_field_desc: "field_desc", + expected_field_desc: 'field_desc', expected_args_name: :args_name, - expected_args_desc: "args_desc", + expected_args_desc: 'args_desc', }, ] cases.each do |c| it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do @@ -174,30 +174,30 @@ context :bin_name do cases = [ { case_no: 1, - case_title: "valid bin name", - input: "abcdefghijklmnopqrstuvwxyz01234567891_", - expected: "abcdefghijklmnopqrstuvwxyz01234567891_" + case_title: 'valid bin name', + input: 'abcdefghijklmnopqrstuvwxyz01234567891_', + expected: 'abcdefghijklmnopqrstuvwxyz01234567891_' }, { case_no: 2, - case_title: "empty bin name", - input: "", + case_title: 'empty bin name', + input: '', expect_error: true }, { case_no: 3, - case_title: "nil bin name", + case_title: 'nil bin name', input: nil, expect_error: true }, { case_no: 4, - case_title: "invalid bin name contain space", - input: "bin name", + case_title: 'invalid bin name contain space', + input: 'bin name', expect_error: true }, ] cases.each do |c| @@ -208,10 +208,10 @@ # -- given -- dslable_dsl = Dslable::Dsl.new # -- when -- if c[:expect_error] - lambda {dslable_dsl.bin_name c[:input]}.should raise_error(Dslable::InvalidDslError) + lambda { dslable_dsl.bin_name c[:input] }.should raise_error(Dslable::InvalidDslError) next end dslable_dsl.bin_name c[:input] actual = dslable_dsl._bin_name