Sha256: 63c12ccf5b5cf8d9321a8dffb4504d623fa35cd0db5196b708eab6063a4dd33c

Contents?: true

Size: 269 Bytes

Versions: 12

Compression:

Stored size: 269 Bytes

Contents

RSpec::Matchers.define :have_accessor do |*args|
  accessor = args.shift or raise ArgumentError, "No accessor name supplied"
  value = args.shift || :foo

  match do |construct|
    construct.send("#{accessor}=", value)
    construct.send(accessor) == value
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
taketo-0.3.1 spec/support/matchers/have_accessor_matcher.rb
taketo-0.3.0 spec/support/matchers/have_accessor_matcher.rb
taketo-0.2.0 spec/support/matchers/have_accessor_matcher.rb
taketo-0.2.0.alpha spec/support/matchers/have_accessor_matcher.rb
taketo-0.1.3 spec/support/matchers/have_accessor_matcher.rb
taketo-0.1.2 spec/support/matchers/have_accessor_matcher.rb
taketo-0.1.1 spec/support/matchers/have_accessor_matcher.rb
taketo-0.1.0 spec/support/matchers/have_accessor_matcher.rb
taketo-0.0.10 spec/support/matchers/have_accessor_matcher.rb
taketo-0.0.9 spec/support/matchers/have_accessor_matcher.rb
taketo-0.0.8 spec/support/matchers/have_accessor_matcher.rb
taketo-0.0.7 spec/support/matchers/have_accessor_matcher.rb