Class: CommandTest::RSpec::RunCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/command_test/adapters/rspec.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ RunCommand

Returns a new instance of RunCommand.



19
20
21
# File 'lib/command_test/adapters/rspec.rb', line 19

def initialize(expected)
  @expected = expected
end

Instance Method Details

#failure_message_for_shouldObject



28
29
30
# File 'lib/command_test/adapters/rspec.rb', line 28

def failure_message_for_should
  @test.positive_failure_message
end

#failure_message_for_should_notObject



32
33
34
# File 'lib/command_test/adapters/rspec.rb', line 32

def failure_message_for_should_not
  @test.negative_failure_message
end

#matches?(proc) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/command_test/adapters/rspec.rb', line 23

def matches?(proc)
  @test = Tests::RunsCommand.new(@expected, &proc)
  @test.matches?
end