Permalink
Browse files

Convert double-quoted strings to single-quoted strings when there is …

…no interpolation.

17 files were modified.
  • Loading branch information...
1 parent 8e4200b commit bbbb0c4134f845d342be5f8c08c279b2a8f0e1b9 ACRE committed Oct 18, 2013
@@ -27,7 +27,7 @@
end
When(/^I execute "(.*?)"$/) do |code|
- step "I execute the following code:", code
+ step 'I execute the following code:', code
end
When(/^I evaluate the following code:$/) do |code|
@@ -43,7 +43,7 @@
end
Then(/^it should return "([^"]+)"$/) do |retval|
- step "it should return the following:", retval
+ step 'it should return the following:', retval
end
Then(/^the following should raise an exception:$/) do |code|
@@ -18,7 +18,7 @@ def List(valstr, &block)
end
def Timeish(val)
- raise ArgumentError, "can't convert nil to Timeish" if val.nil?
+ raise ArgumentError, 'can't convert nil to Timeish' if val.nil?
@david
david Oct 19, 2013 Member

This is a bug in ACRE. (@shoe)

@shoe
shoe Oct 19, 2013 Member

yep, fixed now.

return val if Date === val || Time === val || DateTime === val
View
@@ -1,3 +1,3 @@
module Dill
- VERSION = "0.5.2"
+ VERSION = '0.5.2'
end
@@ -3,7 +3,7 @@ class Document
include WidgetContainer
def initialize(widget_lookup_scope)
- self.widget_lookup_scope = widget_lookup_scope or raise "No scope given"
+ self.widget_lookup_scope = widget_lookup_scope or raise 'No scope given'
end
def root
@@ -3,7 +3,7 @@
describe Dill::Conversions do
include Dill::Conversions
- describe "Boolean" do
+ describe 'Boolean' do
['yes', 'true', true].each do |val|
it "converts #{val.inspect} to true" do
expect(Boolean(val)).to be_true
@@ -17,27 +17,27 @@
end
end
- describe "List" do
- it "converts an empty string to an empty list" do
+ describe 'List' do
+ it 'converts an empty string to an empty list' do
expect(List('')).to eq []
end
- it "converts a blank string to an empty list" do
+ it 'converts a blank string to an empty list' do
expect(List(' ')).to eq []
end
- it "converts a comma separated string to a list" do
+ it 'converts a comma separated string to a list' do
expect(List(' one, two , three four')).to eq ['one', 'two', 'three four']
end
- it "transforms a comma separated string to a list" do
+ it 'transforms a comma separated string to a list' do
expect(List(' one, two , three four') { |v| "#{v}#{v}"}).
to eq ['oneone', 'twotwo', 'three fourthree four']
end
end
describe 'Timeish' do
- it "it converts a timeish string to time" do
+ it 'it converts a timeish string to time' do
expect(Timeish('1 hour ago')).to be_a(Time)
end
@@ -47,8 +47,8 @@
end
end
- it "converts a formatted date string to Time" do
- expect(Timeish("2013-04-20 15:33:00")).to be_a(Time)
+ it 'converts a formatted date string to Time' do
+ expect(Timeish('2013-04-20 15:33:00')).to be_a(Time)
end
end
end
@@ -17,17 +17,17 @@ class Inner < Dill::Widget
HTML
describe '#widget' do
- context "when the widget is at the top level" do
+ context 'when the widget is at the top level' do
Then { widget(:top).class == Top }
end
- context "when the widget is unknown" do
+ context 'when the widget is unknown' do
When(:error) { widget(:unknown) }
Then { error == Failure(Dill::Missing) }
end
- context "when the widget is not at the top level" do
+ context 'when the widget is not at the top level' do
When(:error) { widget(:inner) }
Then { error == Failure(Dill::Missing) }
@@ -1,92 +1,92 @@
require 'spec_helper'
describe Dill::DynamicValue do
- describe "unchanging equality" do
+ describe 'unchanging equality' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
Then { value == value }
Then { value == 'b' }
Then { ! (value != 'b') }
end
- describe "delayed equality" do
+ describe 'delayed equality' do
Given(:value) { v = 'a'; Dill::DynamicValue.new { v.succ! } }
Then { value == 'd' }
end
- describe "unchanging inequality" do
+ describe 'unchanging inequality' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
Then { value != 'c'}
Then { ! (value == 'c') }
end
- describe "delayed inequality" do
+ describe 'delayed inequality' do
Given(:value) { v = 'a'; Dill::DynamicValue.new { v.succ! } }
Then { value != 'a' }
end
- describe "unchanging pattern matching" do
+ describe 'unchanging pattern matching' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
Then { value =~ /b/ }
Then { value !~ /c/ }
end
- describe "delayed pattern matching" do
+ describe 'delayed pattern matching' do
Given(:value) { v = 'a'; Dill::DynamicValue.new { v.succ! } }
Then { value =~ /f/ }
Then { value !~ /b/ }
end
- describe "unchanging delegated comparison" do
+ describe 'unchanging delegated comparison' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
Then { value < 'c' }
Then { value > 'a' }
end
- describe "delayed delegated comparison" do
+ describe 'delayed delegated comparison' do
Given(:value) { v = 'a'; Dill::DynamicValue.new { v.succ! } }
Then { value > 'b' }
end
- describe "inspect value" do
+ describe 'inspect value' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
When(:inspection) { value.inspect }
Then { inspection == '"b"' }
end
- describe "responds to missing" do
+ describe 'responds to missing' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
Then { value.respond_to?(:<) }
end
- describe "matching" do
+ describe 'matching' do
Given(:value) { Dill::DynamicValue.new { 'b' } }
- context "simple match" do
+ context 'simple match' do
Then { value.match(/b/) }
end
- context "match with block" do
+ context 'match with block' do
When(:result) { value.match(/b/) { |m| 'w00t!' } }
Then { result == 'w00t!' }
end
- context "no match" do
+ context 'no match' do
Then { ! value.match(/No match/) }
end
- context "no match with position" do
+ context 'no match with position' do
Then { ! value.match(/b/, 2) }
end
end
@@ -28,23 +28,23 @@ class BTable < ATable
let(:table) { OpenStruct.new(hashes: hashes) }
shared_examples_for 'table' do
- it "passes header through" do
+ it 'passes header through' do
expect(t).to have_key(:passthrough)
end
- it "returns passthrough value" do
+ it 'returns passthrough value' do
expect(t[:passthrough]).to eq 'a_str'
end
- it "converts header" do
+ it 'converts header' do
expect(t).to have_key(:a_symbol)
end
- it "returns converted header value" do
+ it 'returns converted header value' do
expect(t[:a_symbol]).to eq 'converted'
end
- it "converts value with predefined conversion" do
+ it 'converts value with predefined conversion' do
expect(t[:full2]).to eq true
end
end
@@ -54,7 +54,7 @@ class BTable < ATable
it_should_behave_like 'table'
- it "converts value" do
+ it 'converts value' do
expect(t[:full]).to eq 3
end
end
@@ -64,7 +64,7 @@ class BTable < ATable
it_should_behave_like 'table'
- it "converts with overriden conversion" do
+ it 'converts with overriden conversion' do
expect(t[:full]).to eq 1
end
end
@@ -2,7 +2,7 @@
describe Dill::FieldGroup do
shared_examples_for 'a field' do
- context "when using an auto locator" do
+ context 'when using an auto locator' do
Then { w.has_widget?(:auto_locator) }
end
end
@@ -29,16 +29,16 @@
check_box :auto_locator
end
- context "when defining" do
+ context 'when defining' do
Then { w_class.field_names.include?(:unchecked_box) }
end
- context "when querying" do
+ context 'when querying' do
Then { w.checked_box == true }
Then { w.unchecked_box == false }
end
- context "when setting" do
+ context 'when setting' do
When { w.checked_box = false }
When { w.unchecked_box = true }
@@ -95,23 +95,23 @@
select :auto_locator
end
- context "when defining" do
+ context 'when defining' do
Then { w_class.field_names.include?(:deselected) }
end
- context "when querying" do
+ context 'when querying' do
Then { w.deselected.nil? }
- Then { w.selected == "Selected option" }
+ Then { w.selected == 'Selected option' }
end
- context "when setting" do
- When { w.selected = "Unselected option" }
- When { w.deselected = "One" }
- When { w.by_value = "t"}
+ context 'when setting' do
+ When { w.selected = 'Unselected option' }
+ When { w.deselected = 'One' }
+ When { w.by_value = 't'}
- Then { w.selected == "Unselected option" }
- Then { w.deselected == "One" }
- Then { w.by_value == "Two" }
+ Then { w.selected == 'Unselected option' }
+ Then { w.deselected == 'One' }
+ Then { w.by_value == 'Two' }
end
context 'when transforming to table' do
@@ -148,21 +148,21 @@
text_field :auto_locator
end
- context "when defining" do
+ context 'when defining' do
Then { w_class.field_names.include?(:empty_field) }
end
- context "when querying" do
+ context 'when querying' do
Then { w.empty_field.nil? }
- Then { w.filled_field == "Field contents" }
+ Then { w.filled_field == 'Field contents' }
end
- context "when setting" do
- When { w.empty_field = "Some text" }
+ context 'when setting' do
+ When { w.empty_field = 'Some text' }
When { w.filled_field = nil }
- Then { w.empty_field == "Some text" }
- Then { w.filled_field == "" }
+ Then { w.empty_field == 'Some text' }
+ Then { w.filled_field == '' }
end
describe '#to_table' do
@@ -33,7 +33,7 @@
Then { widget == 'Right' }
end
- context "the widget can't be targeted unambiguously" do
+ context 'the widget can't be targeted unambiguously' do
GivenHTML <<-HTML
<span class="multiple">First</span>
<span class="multiple">Second</span>
@@ -50,7 +50,7 @@
Then { ambiguous == Failure(Capybara::Ambiguous) }
end
- context "the widget root doesn't exist" do
+ context 'the widget root doesn't exist' do
GivenHTML <<-HTML
<span id="single">Single</span>
HTML
@@ -9,9 +9,9 @@
root '#item'
end
- describe "#to_row" do
+ describe '#to_row' do
When(:row) { w.to_row }
- Then { row == ["Item"] }
+ Then { row == ['Item'] }
end
end
Oops, something went wrong.

0 comments on commit bbbb0c4

Please sign in to comment.