Add spec for media() #58

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

kaishin commented Jan 29, 2013

  • Use 'with argument' instead of 'when passed' in context definitions
Add spec for media()
* Uses 'with argument' instead of 'when passed' in context definitions
spec/support/matchers/be_contained_in.rb
+RSpec::Matchers.define :be_contained_in do |expected|
+ match do |actual|
+ @query = ParserSupport.parser.find_by_selector(actual, expected)
+ !@query.empty?
@jayroh

jayroh Jan 29, 2013

@query.present? instead of the double negative

@kaishin

kaishin Jan 29, 2013

@jayroh @query is an array. Is there another way to check if it's not empty?

@kaishin

kaishin Jan 29, 2013

Settled for @query.any?

+ expect('.change-media-context').to have_rule('width: 100%')
+ end
+ end
+
@jayroh

jayroh Jan 29, 2013

delete new-line

@kaishin kaishin closed this in ffcf034 Jan 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment